iOS7添加了动态调整文字的大小,app可以通过接受通知的方式进行设置
iOS 7 introduces Dynamic Type, which makes it easy to display great-looking text in your app.
When you adopt Dynamic Type, you get:
-
Automatic adjustments to letter spacing and line height for every font size.
-
The ability to specify different text styles for semantically distinct blocks of text, such as
Body
,Footnote
, orHeadline
. -
Text that responds appropriately when users change their preferred text size in Settings.
To take advantage of these features, be prepared to respond to the notifications that get sent when users change the text size setting. Then, use the UIFont
method preferredFontForTextStyle
to get the new font to use in your UI. iOS 7 optimizes fonts that are specified by this method for maximum legibility at every size. To learn more about text styles and using fonts in your app, see “Text Styles” in Text Programming Guide for iOS.