2014-08-29 77 views
-1

当用户在设置中选择首选文本大小时,我正在更改按钮中的文本大小。我做这样的:“动态类型”更改按钮的字体大小

UIFont *font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; 

self.button.font = font; 

它的工作,但我得到一个错误:

font is deprecated:first deprecated in IOS 3.0

我不知道是否还有另一种,实现更正确的方式。

回答

1

您需要改用self.button.titleLabel.font = font;(请参阅docs)。

1

使用

self.button.titleLabel.font = font;