Status bar won't disappear

user2397282 picture user2397282 · Jul 20, 2013 · Viewed 90.8k times · Source

I'm creating an application and I want the status bar hidden. When I test the app, the status bar is hidden whilst the splash screen is shown, but once the app is fully loaded, the status bar reappears.

I'm using Xcode 5 and iOS 7, and have tried disabling the status bar programatically

  ([[UIApplication sharedApplication] setStatusBarHidden:YES    
      withAnimation:UIStatusBarAnimationFade];),

in the info.plist file, and using the attributes inspector on the .xib file. Nothing appears to work.

Any ideas?

Answer

Quentin picture Quentin · Jul 30, 2013

Try adding the following method to your app's root view controller:

- (BOOL)prefersStatusBarHidden
{
    return YES;
}