UIStatusBarStyle not working in Swift

前端 未结 11 590
轻奢々
轻奢々 2020-12-22 18:30

I\'m trying to change the Status Bar color in my Swift app to white, but am hitting a brick wall. I have 3 ViewControllers that are each embedded in a NavigationController (

11条回答
  •  一向
    一向 (楼主)
    2020-12-22 19:09

    Strange, using Swift 3.1 & XC8.2.1, but all of the above didn't work.

    What I did, is just

    extension UINavigationController
    {
        override open var preferredStatusBarStyle: UIStatusBarStyle {
            get {
                return .lightContent
            }
        }
    }
    

    No Plist, no other stuff. HTH

提交回复
热议问题