首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >setTranslatesAutoresizingMaskIntoConstraints :无法调用非函数类型Bool的值

setTranslatesAutoresizingMaskIntoConstraints :无法调用非函数类型Bool的值
EN

Stack Overflow用户
提问于 2018-06-06 07:16:34
回答 1查看 258关注 0票数 0

我有以下代码:

代码语言:javascript
复制
let button = UIButton(type: .system) as UIButton
button.setTitle(title, for: .normal)
button.setTranslatesAutoresizingMaskIntoConstraints(false)

但是Xcode (9.4)抱怨说

类型为“'setTranslatesAutoresizingMaskIntoConstraints'”的

值没有成员UIButton

EN

回答 1

Stack Overflow用户

发布于 2018-06-06 07:27:33

对于Swift4 (Xcode9.4),必须将其更改为以下内容:

代码语言:javascript
复制
button.translatesAutoresizingMaskIntoConstraints = false
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50710175

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档