setFont Deprecated?

前端 未结 3 964
无人及你
无人及你 2020-12-14 00:28

I get a warning saying that setFont is deprecated?

[button setFont:[UIFont boldSystemFontOfSize:13]];

Any suggestions how to take it away p

3条回答
  •  甜味超标
    2020-12-14 01:13

    Setting the font of the button directly is depracated in 3.x versions of the SDK. Instead, you need to set the properties of the button's titleLabel property.

    Code: (mybutton).titleLabel.font = [UIFont systemFontOfSize:13];

    Source: http://www.iphonedevsdk.com/forum/iphone-sdk-development/26126-warning-setting-font-button.html

提交回复
热议问题