Set UIButton title UILabel font size programmatically

前端 未结 18 3102
灰色年华
灰色年华 2020-12-07 07:16

I need to set the font size of the title UILabel of a UIButton programmatically.

18条回答
  •  时光说笑
    2020-12-07 07:59

    [button setFont:...] has been deprecated.

    Use [button.titleLabel setFont:...] instead, for example:

    [myButton.titleLabel setFont:[UIFont systemFontOfSize:10]];

提交回复
热议问题