【发布时间】:2023-04-04 12:07:01
【问题描述】:
我正在尝试从 CGRect 框架创建 UIView。 CGRectMake() 中的每个参数都是 CGFloats。
var views:UIView = UIView(frame:CGRectMake(CGFloat(hotspotScroll.frame.size.width * i + 20), CGFloat(10),CGFloat(hotspotScroll.frame.size.width - 40), CGFloat(hotspotScroll.frame.size.height - 20)))
但它给了我一个错误:
Cannot invoke '+' with an argument list of type '(frame: CGRect)'
为什么会这样?
【问题讨论】:
标签: ios xcode swift cgrect cgfloat