参考网址:
https://stackoverflow.com/questions/56537855/is-it-possible-to-opt-out-of-dark-mode-on-ios-13
According to Apple's "Implementing Dark Mode on iOS" Session (https://developer.apple.com/videos/play/wwdc2019/214/ starting at 31:13) it is possible to set overrideUserInterfaceStyle
to UIUserInterfaceStyleLight
or UIUserInterfaceStyleDark
on any view controller or view, which will the be used in the traitCollection
for any subview or view controller.
As already mentioned by SeanR, you can set UIUserInterfaceStyle to Light or Dark in you app's plist file to change this for your whole app.
即在info.plist中添加UIUserInterfaceStyle设置为light或者dark即可强制修改模式