我有以下代码:
let button = UIButton(type: .system) as UIButton
button.setTitle(title, for: .normal)
button.setTranslatesAutoresizingMaskIntoConstraints(false)
但是Xcode (9.4)抱怨说
类型为“'setTranslatesAutoresizingMaskIntoConstraints'”的
值没有成员UIButton
发布于 2018-06-06 07:27:33
对于Swift4 (Xcode9.4),必须将其更改为以下内容:
button.translatesAutoresizingMaskIntoConstraints = false
https://stackoverflow.com/questions/50710175
复制相似问题