How to prevent status bar from overlapping content with hidesBarsOnSwipe set on UINavigationController?

后端 未结 9 886
灰色年华
灰色年华 2020-12-02 11:10

I\'m trying to use the new feature added in iOS 8 - hiding the navigation bar while user is scrolling the table view (similar to what mobile Safari does). I\'m setting the p

9条回答
  •  春和景丽
    2020-12-02 11:56

    The answer from @iOSergey works perfect!

    Here is the solution in Swift 1.2. Add the following code to the views .swift file:

    override func prefersStatusBarHidden() -> Bool {
    
        return self.navigationController!.navigationBarHidden as Bool
    
    }
    

提交回复
热议问题