不起作用代码:
override var preferredStatusBarStyle: UIStatusBarStyle{
return .lightContent
}
解决办法:
在info.plist 添加key:View controller-based status bar appearance 设置为NO
再设置属性
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOpt
[UIApplicationLaunchOptionsKey: Any]?) -> Bool {
application.statusBarStyle = .lightContent
return true
}