Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 317
tyler53 Avatar asked Aug 30 '13 05:08

tyler53


2 Answers

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

like image 129
Vaibhav Gautam Avatar answered Sep 29 '22 03:09

Vaibhav Gautam


What I usually do is add two key-value properties to the Info.plist file.

enter image description here

The properties source code is:

enter image description here

like image 28
German Attanasio Avatar answered Sep 29 '22 03:09

German Attanasio