preferredStatusBarStyle

preferredStatusBarStyle

如何根据此重写代码段;
“statusBarStyle”的Setter在iOS 9.0中已弃用:Use-[UIViewController preferredStatusBarStyle]

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

        return true
    }

最佳答案

这是状态栏样式的新方法

override var preferredStatusBarStyle: UIStatusBarStyle {
      return .lightContent
}

关于swift - iOS 9.0中已弃用“statusBarStyle”的 setter :使用-[UIViewController preferredStatusBarStyle],我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/56626939/

10-13 04:00