测试已测试 | ✗ |
Lang语言 | Obj-CObjective C |
许可证 | MIT |
发布上次发布 | 2014年12月 |
由 Michael Kral 维护。
此类别旨在帮助使用在 iOS7 中引入的动态文本大小。您可以使用自己的字体并调整字体大小。
#import "UIFont+DynamicFontControl.h"
UIFont * dynamicFont = [UIFont preferredFontForTextStyle:UIFontTextStyleBody withFontName:@"AmericanTypewriter"];
UIFont * scaledDynamicFont = [UIFont preferredFontForTextStyle:UIFontTextStyleBody withFontName:@"AmericanTypewriter" scale:2.0f];
目前受影响的唯一属性是字体大小。例如,我不会为 UIFontTextStyleHeadline 添加粗体属性。
我计划在不久的将来使用 CoreText 更新此类别以修复此问题。