如何隐藏iOS状态栏 [英] How to hide iOS status bar

查看:186
本文介绍了如何隐藏iOS状态栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的iOS视频应用中,状态栏隐藏在某些视图控制器中。我使用以下代码完成了此操作。

In my iOS video app status bar is hidden in some view controllers. I have done this using following code.

[[UIApplication sharedApplication] setStatusBarHidden:YES];




  • 适用于iOS 5和iOS 6,但不适用在iOS 7中。

    • It works for iOS 5 and iOS 6 , but not in iOS 7.

      我在特定的视图控制器中试过这个,

      I tried with this in particular view controller,

      例如:

      -(BOOL)prefersStatusBarHidden { return YES; }
      

      它运行良好,但我无法再在父视图控制器中显示状态栏。

      It works well, but I cant show status bar again in the parent view controller.

      推荐答案

      您应该将此值添加到plist:查看基于控制器的状态栏外观和将其设为

      You should add this value to plist: "View controller-based status bar appearance" and set it to "NO".

      这篇关于如何隐藏iOS状态栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆