Cannot hide status bar in iOS7

I just upgraded my iPhone 5 iOS 7 to four beta version. Now when I run my app from Xcode 5 on this iPhone, status bar doesn't hide, even though it should.

Not Working:

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

Not Working:

[UIApplication sharedApplication].statusBarHidden = YES;

Can't login to Apple Developer Forums


in your apps plist file add a row call it "View controller-based status bar appearance" and set it to NO

Note that this simply does not work, if you are using UIImagePickerController in the app.

from http://www.openfl.org/developer/forums/general-discussion/iphone-5ios-7-cant-hide-status-bar/, mgiroux's solution

将View Base Controller添加到Xcode中的Info设置的示例


在视图控制器中添加方法。

- (BOOL)prefersStatusBarHidden {
    return YES;
}

In the Plist add the following properties.

-> Status bar is initially hidden = YES

-> View controller-based status bar appearance = NO

Add both - now the status bar will disappear.

链接地址: http://www.djcxy.com/p/95792.html

上一篇: 将xcode 4.6 iPhone应用转换为通用应用

下一篇: 无法在iOS7中隐藏状态栏