且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在模拟器上启用暗模式?

更新时间:2022-03-01 22:58:41

在 Xcode 11 中有两种方法可以激活暗模式.这两种方法都需要您手动操作,并且不会根据时间自动执行.

There are two ways to activate the dark mode in Xcode 11. Both require you manual steps and are not automatic depending on the time.

1.环境覆盖

首选的是在 Xcode 中使用 Environment Overrides.在 Xcode 中的模拟器上运行应用程序时,调试器控件中调试内存图"和模拟位置"旁边会出现一个按钮.您会在那里找到一个用于启用暗模式以及选择文本大小和其他辅助功能设置的菜单.

The preferred one is to use the Environment Overrides inside Xcode. When running the App on the simulator in Xcode appears a button in the debugger controls next to 'Debug Memory Graph' and 'Simulate Location'. There you will find a menu for enabling dark mode, as well as choose text size and other accessibility settings.

2.模拟器设置

或者,您可以进入模拟器上的设置应用程序:

Alternatively you can go inside the Settings App on the simulator:

设置 > 开发者 > 深色外观

Settings > Developer > Dark Appearance