在info中設(shè)置
<key>UIUserInterfaceStyle</key>
<string>Light</string>
關(guān)閉某個(gè)界面黑暗模式
.light
.dark
.unspecified
viewController.overrideUserInterfaceStyle =
app在系統(tǒng)黑暗模式下可以正常顯示了。但是仔細(xì)看會(huì)發(fā)現(xiàn)狀態(tài)欄無法顯示!
在項(xiàng)目的target對(duì)應(yīng)的info.plist中添加以下設(shè)置:
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>