您的位置:首页 > 移动开发 > IOS开发

iOS7动态调整文字大小

2013-09-23 17:15 330 查看

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



A message at the largest non Accessibility size



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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: