即使 UIStatusBarHidden 为 YES,如何防止 iOS 5 显示状态栏?
一些用户报告称,iOS 5 有时会显示状态栏。
在我的 Info.plist 中,UIStatusBarHidden 键是 YES,我从不乱搞代码中的状态栏。
我能做什么来解决这个问题?
Some users reported that iOS 5 sometimes shows the status bar.
In my Info.plist the UIStatusBarHidden key is YES, and I never mess around with the status bar in code.
What can I do to fix that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
Info.plist 中的条目应该足以隐藏它,但您可以尝试以编程方式执行此操作:
当您的应用程序启动时。
the entry in the Info.plist should be enough to hide it, but you can try doing it programmatically with:
when your app starts up.
我认为上述方法在 iOS5 中已被弃用,我会使用这个方法:
I think the above method is deprecated in iOS5, I would use this one instead:
找到解决方案了!
我确实在 plist 中设置了属性,但在将视图控制器推入导航堆栈或打开 UIImagePickerController 后,状态栏仍然可见:
(我使用 Xcode 4.2(SDK 5.0)和 iOS 5.0.1)。
这是(将代码放入每个不需要状态栏可见的视图控制器中):
Set self.wantsFullScreenLayout = YES;
它可以
然后
。
在通过导航堆栈推送控制器以及使用 UIImagePickerController (拍照或取消)的情况下工作
希望这有帮助。
Found the solution!
I did set property in the plist but was still getting status bar visible after pushing a view controller into the navigation stack or opening UIImagePickerController:
(I use Xcode 4.2 (SDK 5.0) and iOS 5.0.1).
Here it is (put the code in every View Controller you don't need status bar to be visible):
Set self.wantsFullScreenLayout = YES;
in
call
in
Then it works in case of pushing controllers through navigation stack as well as using UIImagePickerController (both taken picture or cancelled).
Hope this helps.
上隐藏状态栏的选中选项
xcode 4.5
为您提供了在摘要页面转到项目目标xcode 4.5
gives you an check Option to hide status bar on summary page您是否使用显示状态栏的第三方框架?
Are you using 3rd party frameworks that show the status bar?