How to change font of UIButton with Swift

前端 未结 16 1269
故里飘歌
故里飘歌 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:16

    You should go through the titleLabel property.

    button.titleLabel.font

    The font property has been deprecated since iOS 3.0.

提交回复
热议问题