iOS 9.0中已弃用“ statusBarStyle”的设置器:使用-[UIViewController preferredStatusBarStyle]

时间:2019-06-17 07:51:36

标签: swift

如何根据此方法重写代码段; iOS 9.0中已弃用“ statusBarStyle”的二传手:使用-[UIViewController preferredStatusBarStyle]

func application(_ application: UIApplication, 
                    didFinishLaunchingWithOptions launchOptions: 
       [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
       FirebaseApp.configure()
       UIApplication.shared.statusBarStyle = .lightContent

        return true
    }

1 个答案:

答案 0 :(得分:0)

这是状态栏样式的新方法

override var preferredStatusBarStyle: UIStatusBarStyle {     
      return .lightContent
}