Search code examples
iphoneiosinterface-builderstatusbar

Status Bar Still Showing


I am getting REALLY frustrated!!

I have tried every living possibility to get rid of the UIStatusBar at the top of my app...

I have tried:

  • Setting Status Bar to "None" in IB

  • Running [[UIApplication sharedApplication] setStatusBarHidden:YES]; on application launch AND in each scene.

  • Going to the .plist and changing the value for Status Bar Hidden at Startup: YES

  • Setting that same value on the home page for the target

  • Setting - (BOOL)prefersStatusBarHidden { return YES; } in the app delegate

Literally none of this works... It still shows up on all of my views, and it is SUPER frustrating

Thanks again :)

Side note: I'm in xcode 5, developer beta iOS 7 beta 6, but this also happens on my old ios6 and xcode 4 apps


Solution

  • Please try this

    //viewDidload
    if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {
        // iOS 7
        [self prefersStatusBarHidden];
        [self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
    } else {
        // iOS 6
        [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
    }
    
    
    // Add this Method
    - (BOOL)prefersStatusBarHidden
    {
    return YES;
    }
    

    This code has been taken from this link