在iOS8上,以横向模式显示我的应用程序将隐藏状态栏,但在iOS 7上,状态栏将显示在两个方向上 [英] On iOS8, displaying my app in landscape mode will hide the status bar but on iOS 7 the status bar is displayed on both orientations

查看:121
本文介绍了在iOS8上,以横向模式显示我的应用程序将隐藏状态栏,但在iOS 7上,状态栏将显示在两个方向上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望状态栏在iOS 8中以两个方向显示;它在iOS 7中正确显示。

I want the status bar to be displayed in both orientations in iOS 8; it's being displayed properly in iOS 7.

navigationController.isNavigationBarHidden 返回NO。

为什么iOS 8会这样做?

Why is iOS 8 doing this?

推荐答案

试试这个

中添加以下代码didRotateFromInterfaceOrientation

[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];

编辑

无需所有视图控制器中的写代码

设置查看基于控制器的状态栏外观 in plist 并在
根视图控制器的 viewDidLoad


EDIT
NO NEED TO WRITE CODE IN ALL VIEW CONTROLLER
Set View controller-based status bar appearance to NO in plist and add below code in root view controller's viewDidLoad

[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];

演示项目

https://www.dropbox.com/s/uumneidk4wom5md/demoStatusBar.zip?dl=0

这篇关于在iOS8上,以横向模式显示我的应用程序将隐藏状态栏,但在iOS 7上,状态栏将显示在两个方向上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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