相关疑难解决方法(0)

UIControlState.Normal不可用

此前的UIButton情况下,你能够传递UIControlState.NormalsetTitlesetImage. .Normal不再可用,我应该使用什么?

let btn = UIButton(frame: CGRect(x: 0, y: 0, width: 20, height: 20))
btn.setTitle("title", for: .Normal) // does not compile
Run Code Online (Sandbox Code Playgroud)

(这是一个规范的问答对,以防止与此相关的重复问题UIButton以及UIControliOS 10和Swift 3的变化)

uibutton ios swift swift3 xcode8

13
推荐指数
1
解决办法
9896
查看次数

标签 统计

ios ×1

swift ×1

swift3 ×1

uibutton ×1

xcode8 ×1