2

嗨,我正在将我的通用应用程序从 iOS6 升级到 iOS7。我通过在 .plist 文件中使用它来隐藏状态栏:

-> Status bar is initially hidden = YES
-> View controller-based status bar appearance = NO

然后在我的 AppDelegate didFinishLaunchingWithOptions:里面我添加了:

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

运行时状态栏正确隐藏:

  • IOS6 [iPhone,iPad]
  • IOS7 [iPhone]

我只在 iPad/iOS7 上遇到问题。我不能在这里隐藏它!

有什么帮助吗?

4

2 回答 2

1

make sure your xcode project is not target only for iphone.

in my case, my xcode project is target only for iphone, and i'm building my project in ipad with 2x zoom so non of hide statusBar solution worked for me. here is my Solution, i just change Device type to ipad under Deployment info column. and apply this

Status bar is initially hidden = YES
View controller-based status bar appearance = NO

into info.plist

于 2014-09-13T06:59:07.530 回答
0

试试这个http://www.openfl.org/community/general-discussion/iphone-5ios-7-cant-hide-status-bar/

我从这篇文章中找到它Cannot hide status bar in iOS7

您仍然可以隐藏状态栏,但由应用程序中的每个视图控制器子类来覆盖:prefersStatusBarHidden 返回 YES

于 2014-01-31T17:51:57.397 回答