一、全局關(guān)閉暗黑模式:
在Info.plist中增加Appearance或UIUserInterfaceStyle,值為Light,如下:
注:Appearance與UIUserInterfaceStyle 是同一個
<key>UIUserInterfaceStyle</key>
<string>Light</string>
info.plist.png
二、單頁面關(guān)閉暗黑模式:
self.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
設(shè)置后該視圖及其子視圖以設(shè)置的模式進(jìn)行展示,不跟隨系統(tǒng)模式改變進(jìn)行改變。
此屬性會影響當(dāng)前view/viewController/window 以及它下面的所有內(nèi)容。