iOS7动态调整文字大小

iOS7添加了动态调整文字的大小,app可以通过接受通知的方式进行设置

 

 iOS 7 introduces Dynamic Type, which makes it easy to display great-looking text in your app.

 

A message at the smallest size

image: ../Art/mail_message_7_2x.png

A message at the largest non Accessibility size

image: ../Art/message_large_2x.png

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, or Headline.

  • 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.

 

posted @ 2013-09-23 17:15  hellocby  阅读(1309)  评论(0编辑  收藏  举报