6

Some users reported that iOS 5 sometimes shows the status bar.

In my Info.plist the UIStatusBarHidden key is YES, and I never mess around with the status bar in code.

What can I do to fix that?

dontWatchMyProfile
  • 45,440
  • 50
  • 177
  • 260
  • I've just started developing a new project with SDK 5.0, (Target 4.0) and have the same problem. I set UIStatusBarHidden = YES in plist OR call [[UIApplication sharedApplication] setStatusBarHidden: YES withAnimation: UIStatusBarAnimationNone]; and anyway the status bar appear on each subseqeunt screen opening. Notify me please if you find a working solution. – Kostiantyn Sokolinskyi Jan 18 '12 at 16:52
  • see my reply below. I did manage to fix it. – Kostiantyn Sokolinskyi Jan 19 '12 at 07:04

5 Answers5

6

the entry in the Info.plist should be enough to hide it, but you can try doing it programmatically with:

[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];  

when your app starts up.

Mike K
  • 2,227
  • 1
  • 12
  • 6
6

I think the above method is deprecated in iOS5, I would use this one instead:

[[UIApplication sharedApplication]setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone]; 
amunita
  • 71
  • 3
2

xcode 4.5 gives you an check Option to hide status bar on summary page

  1. Go to Target of project.
  2. Open sumaary and then check the Hide StatusBar Option..
The iOSDev
  • 5,237
  • 7
  • 41
  • 78
Sahil Mahajan
  • 3,922
  • 2
  • 29
  • 43
2

Found the solution!

I did set property in the plist but was still getting status bar visible after pushing a view controller into the navigation stack or opening UIImagePickerController: (I use Xcode 4.2 (SDK 5.0) and iOS 5.0.1).

Here it is (put the code in every View Controller you don't need status bar to be visible):

Set self.wantsFullScreenLayout = YES; in

- (id)initWithNibName: (NSString*)nibNameOrNil bundle: (NSBundle*)nibBundleOrNil

call

[[UIApplication sharedApplication] setStatusBarHidden: YES withAnimation: UIStatusBarAnimationNone];

in

- (void)viewWillAppear: (BOOL)animated

Then it works in case of pushing controllers through navigation stack as well as using UIImagePickerController (both taken picture or cancelled).

Hope this helps.

Janak Nirmal
  • 22,706
  • 18
  • 63
  • 99
1

Are you using 3rd party frameworks that show the status bar?

Ashley Mills
  • 50,474
  • 16
  • 129
  • 160