Value of type '(CGRect) -> CGRect' has no member:是因为你变量类型定义错了
文章目录
Value of type '(CGRect) -> CGRect' has no member:是因为你变量类型定义错了
Value of type '(CGRect) -> CGRect' has no member 'maxY'
Value of type '(CGRect) -> CGRect' has no member 'maxX'
Value of type '(CGRect) -> CGRect' has no member 'width'
Value of type '(CGRect) -> CGRect' has no member 'height'
Value of type '(CGRect) -> CGRect' has no member 'size'
是因为你定义的某个变量属性不对,多半应该是 CGFloat,而你没有规定变量类型,系统默认识别成了 Int 或者 Double 类型
let frameWidth = 300 // 识别为 Int
// 改为
let frameWidth: CGFloat = 300
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论