dynamic-type-feature

A better way to use Dynamic Type with a custom font in Swift 3/iOS10

只谈情不闲聊 提交于 2019-12-20 12:39:04
问题 I tried two ways: Method 1: label.font = UIFont.preferredFont(forTextStyle: UIFontTextStyle.body) label.adjustsFontForContentSizeCategory = true This works fine, even when the preferred text size is changed in the Settings, the text size changes automatically, even before when I go back to the app. But it only works with the system font (San Francisco). Method 2: To use a custom font, I add an extension to UIFontDescriptor : //from this answer http://stackoverflow.com/a/35467158/2907715

Is there a faster way to change accessibility (dynamic type) text size on iOS simulator?

时光毁灭记忆、已成空白 提交于 2019-12-02 03:18:46
问题 On my iPhone XS, I created a shortcut in the Control Center to quickly change the text size and test to make sure all the sizes work on my iPhone. However, I'm often in the simulator trying to test, and it's tedious to need to switch to the Settings app and go through multiple menus to switch the text size. Since the simulator has no Control Center, is there another way to more easily change the text size? 回答1: The best way to reach your goal depends on the Xcode version you're using. In