1.深色模式
可以在info.plist里配置
<key>User Interface Style</key>
<string>Light</string>
關(guān)閉深色模式
也可以獲取ios13的主題模式
if(@available(iOS13.0, *)) {
? ? ? ? UIUserInterfaceStyle mode = UITraitCollection.currentTraitCollection.userInterfaceStyle;
? ? ? ? if(mode == UIUserInterfaceStyleDark) {
? ? ? ? ? ? NSLog(@"深色模式");
? ? ? ? }else if(mode == UIUserInterfaceStyleLight) {
? ? ? ? ? ? NSLog(@"淺色模式");
? ? ? ? }else{
? ? ? ? ? ? NSLog(@"未知模式");
? ? ? ? }
? ? }