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 Xcode 10, go to the Xcode - Open Developer Tool menu and select the Accessibility Inspector element:

  1. If you haven't run your simulator, do it now and select it in the panel.
  2. Select the Settings button to display the different text sizes.
  3. Test your dynamic type implementation by changing the font size.

If you need further explanation about this tool, I strongly recommend to take a look at these WWDC detailed summaries that contain very useful information: 2016 and 2019.

In Xcode 11, there's a new option directly accessible from the debug bar in the LOG window: if you haven't run your simulator, do it now and select the LOG window in Xcode:

  1. Select the Environment Overrides button to open the new pane.
  2. Switch the TEXT on, vary the text size and dynamically visualize its rendering on the simulator.

Using these tools is, in my view, the fastest way to test the Dynamic Type feature implementation.




回答2:


You can create a new dedicated simulator for that font size, which you can quickly choose from Xcode. For example:

  1. Create a new simulator by tapping on “Window” » “Devices and Simulators” and tapping on the “+” button in the lower left corner:

  2. Now, when you run the app from Xcode you can choose this new simulator where you “Choose scheme” in the Xcode toolbar:

    For example:

  3. Once you run the app on the simulator, jump to the “Settings” and change your font size there. You now have the two simulators that you can quickly choose from from the Xcode UI. You can even run the app simultaneously from both and watch how your app is rendered in both:



来源:https://stackoverflow.com/questions/58071316/is-there-a-faster-way-to-change-accessibility-dynamic-type-text-size-on-ios-si

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!