UIApplication.sharedApplication().setStatusBarStyle() deprecated in iOS 9

前端 未结 9 652
野的像风
野的像风 2021-02-01 13:34

I have been using

UIApplication.sharedApplication().setStatusBarStyle()

In my appDelegate and it has worked fine, but since iOS 9, this method

相关标签:
9条回答
  • 2021-02-01 14:29

    I think I have found a solution. I ended up setting the

    View controller-based status bar appearance boolean to NO

    In my info.plist file.

    Then I went to my target's General settings -> Deployment info and changed the dropdown option Status Bar Style to Light instead of Default

    This changed the statusbar style to Light for my whole application, just what I wanted.

    I Hope this helps!

    0 讨论(0)
  • 2021-02-01 14:30

    In Swift 3 is like that:

     UIApplication.shared.statusBarStyle = .lightContent
    
    0 讨论(0)
  • 2021-02-01 14:33

    This is the new way in AppDelegate:

    UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent, animated: true)
    
    0 讨论(0)
提交回复
热议问题