iphone - iOS : Hide status bar in entire app programmatically not even through plist

标签 iphone objective-c ios7 statusbar

我想在我的整个应用程序中隐藏状态栏。

我也知道,我们可以通过这种方式做到:

set the key value "View controller-based status bar appearance" NO in plist.

但我只需要为 iOS 7 做同样的事情,所以当然需要一些操作系统版本的条件,据我所知,我们不能在 .plist 文件中应用任何条件。

所以任何人请建议一些只隐藏 iOS 7 状态栏的代码行。

感谢您的回复。

最佳答案

将以下代码添加到您的 View Controller :

- (BOOL)prefersStatusBarHidden {
    return YES;
}

这不会影响任何低于 7 的 ios,因为它只在 ios7 中调用。

关于iphone - iOS : Hide status bar in entire app programmatically not even through plist,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20216592/

相关文章:

iphone - 我在哪里可以免费在线存储我的 plist,我的应用程序可以下载它?

ios - 导航栏动画。为什么。诡异的

iphone - UIImage imageWithData 需要一些时间才能出现

ios - 枚举 ALAssetsLibrary 时,我可以区分屏幕快捷图像和相机拍摄的图像吗?

ios - 操作表内的 UIDatePicker 不工作

ios - 调用 resignFirstResponder 时,什么会导致间歇性 NSInternalInconsistencyException?

iphone - iPhone 上的 SSL 套接字连接

ios - 导出后csv文件中的数据

ios - 飞行模式打开时无法在 iOS 7 中播放本地视频流

ios - iPhone 4 和 iPhone 5 的独立 Storyboard 仅在模拟器中导致崩溃