ios - 二元运算符 * 不能应用于 Int 和 CGFloat 类型的操作数

标签 ios swift

i 的类型是 Int。请帮我解决这个问题?

enter image description here

最佳答案

代替i * self.view.frame.size.width,使用CGFloat(i) * self.view.frame.size.width

关于ios - 二元运算符 * 不能应用于 Int 和 CGFloat 类型的操作数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31737679/

相关文章:

objective-c - 如何从 Swift 调用 Objective-C 代码?

ios - 使用自动布局调整 xib 元素的宽度

ios - [__NSArrayI 长度] : unrecognized selector sent to instance when moving through views

ios - ARC : returning allocated object from a method called by performSelector, 可以吗?

ios - 注释(图像和文本) subview 在保存后更改位置

swift - didBeginContact 没有被称为 Swift

swift - 使用 MTLSharedEvent 在单个命令缓冲区内同步 CPU 和 GPU 之间的工作

ios - 如何获取 MobileVLCKit 的缓冲区百分比?

macos - 滚动时 NSTableView 非常滞后

objective-c - NSRegularExpression 不匹配