Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone/iOS Status bar not hiding in Xcode project

Hi I have tried the following but am unable to remove the status bar from my application:

  1. Set status bar is initially hidden to YES in plist
  2. 'Hide during application launch' to ticked in Project General settings
  3. Set status bar to 'none' in the interface builder file controlling view controllers
  4. Set [UIApplication sharedApplication].statusBarHidden = YES; in app delegate.

All these used to work fine in the 100 applications I did before but I made a recent xcode upgrade..

Is there some other secret way of getting rid of the status bar in the app? Do I need to journey to Apple headquarters and slay a red dragon ?

like image 721
Zigglzworth Avatar asked Mar 10 '14 11:03

Zigglzworth


2 Answers

Found the solution

In your apps plist file add a row call it "View controller-based status bar appearance" and set it to NO

enter image description here

SOURCE - OPENFL

like image 162
Himanshu Joshi Avatar answered Oct 09 '22 08:10

Himanshu Joshi


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;
}
like image 1
madLokesh Avatar answered Oct 09 '22 08:10

madLokesh