2
votes

I've tried everything I can think of/find to hide the status bar on iOS 7, but after the launch it appears:

//in viewDidLoad
    [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];

//in the main view controller
- (BOOL)prefersStatusBarHidden
{
    return YES;
}

I also set "Status bar is initially hidden", and "View controller-based status bar appearance" to YES in the info.plist.

Oddly, the status bar does hide after another controller appears, like a picker or the keyboard.

2
Is your VC hosted by a container view controller?Andrea

2 Answers

2
votes

Try adding a new value to your info.plist:

View Controller based status bar appearance - NO

1
votes

If you don't want view controllers to participate in the style and visibility of the status bar, add a "View Controller based status bar appearance" row to your info.plist and set it to NO. By default, in iOS 7, view controllers can participate in the status bar appearance process by overriding the prefersStatusBarHidden method. You could also notify UIKit about your status bar visibility change by calling [self setNeedsStatusBarAppearanceUpdate].

If it's still not working, post a little bit more code to see a bigger picture of your problem. Maybe the cause is somewhere else.