“动态类型”更改按钮的字体大小
问题描述:
当用户在设置中选择首选文本大小时,我正在更改按钮中的文本大小。我做这样的:“动态类型”更改按钮的字体大小
UIFont *font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
self.button.font = font;
它的工作,但我得到一个错误:
font is deprecated:first deprecated in IOS 3.0
我不知道是否还有另一种,实现更正确的方式。
答
使用
self.button.titleLabel.font = font;