How to change font of UIButton with Swift

前端 未结 16 1291
故里飘歌
故里飘歌 2020-12-12 11:51

I am trying to change the font of a UIButton using Swift...

myButton.font = UIFont(name: \"...\", 10)

However .font is depreca

16条回答
  •  南笙
    南笙 (楼主)
    2020-12-12 12:19

    This works in Swift 3.0:

    btn.titleLabel?.font = UIFont(name:"Times New Roman", size: 20) 
    

提交回复
热议问题