How to hide iOS status bar

Susitha picture Susitha · Sep 24, 2013 · Viewed 183.9k times · Source

In my iOS video app status bar is hidden in some view controllers. I have done this using following code.

[[UIApplication sharedApplication] setStatusBarHidden:YES];
  • It works for iOS 5 and iOS 6 , but not in iOS 7.

  • I tried with this in particular view controller,

Eg:

-(BOOL)prefersStatusBarHidden { return YES; }

It works well, but I cant show status bar again in the parent view controller.

Answer

Rajneesh071 picture Rajneesh071 · Sep 24, 2013

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

enter image description here