How to hide status bar of a single view controller in iOS 9?

后端 未结 15 1245
挽巷
挽巷 2020-12-13 06:15

In a ViewController, which I presented modally, I did this:

override func prefersStatusBarHidden() -> Bool {
    return true
}

This used

15条回答
  •  轮回少年
    2020-12-13 06:42

    UIApplication.sharedApplication().setStatusBarHidden(true, withAnimation: .None) 
    

    and when you want it back in a separate VC:

    UIApplication.sharedApplication().setStatusBarHidden(false, withAnimation: .None) 
    

提交回复
热议问题