Status bar won't disappear

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?


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

- (BOOL)prefersStatusBarHidden
{
    return YES;
}

You should add this value to plist: "View controller-based status bar appearance" and set it to "NO".

This will enable you to set the status bar to hidden mode. This sets it to a global unlike other provided answers.

UPDATE: If you want that the status bar would be hidden on splash screen don't forget to mark "Hide during application launch" on target status bar options. Also, you can add "Status bar is initially hidden" to "YES" on the plist if you don't want to do it with code inside the app.