我一直试图在 SWRevealViewController
中隐藏状态栏,但隐藏状态栏不应该影响另一个 UIViewController
,它应该只隐藏在 Sliding-菜单只打开。隐藏文本和日期等。!
我试过以下方法:
self.setNeedsStatusBarAppearanceUpdate()
override func preferredStatusBarStyle() -> UIStatusBarStyle {
return UIStatusBarStyle.LightContent
}
但是状态栏的颜色只是变成了白色并且仍然没有隐藏! 我不知道怎么可能?
最佳答案
在 setNeedsStatusBarAppearanceUpdate()
之前将 statusBarHidden
属性设置为 true
UIApplication.sharedApplication().statusBarHidden = true
如果您不希望状态栏隐藏在其他 View 中。您可以在 viewWillDisappear
关于ios - 在 SWRevealViewController 中隐藏状态栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32071866/