0

I have hidden the status bar in my app by using:

[[UIApplication sharedApplication] setStatusBarHidden:YES];

But for some reason when the view is initially loaded, I get the view with the disabled status bar, but the space for the bar is still there, see the following for reference: enter image description here

But when I rotate the device, I get the normal behavior:

enter image description here

And if I was to rotate my device back to the portrait view again, everything would look normal and that gap will no longer be there, its only present initially.

Why I'm I having this issue? Please provide as many details as possible

UPDATE: I have deleted all of my

[[UIApplication sharedApplication] setStatusBarHidden:YES]; to follow the solution that was provided here: LINK but unfortunately this is giving me the same result as I posted above.

Community
  • 1
  • 1
vzm
  • 2,440
  • 6
  • 28
  • 47
  • When do you call `setStatusBarHidden`? Have you tried changing your app's plist file instead, as described [here](http://stackoverflow.com/questions/18059703/cannot-hide-status-bar-in-ios7)? – godel9 Nov 09 '13 at 20:16
  • @godel9 it took me a few minutes to respond, as I went thru my code and removed the `setStatusBarHidden` and simply added the .plist instructions but this still gives me the same result unfortunately – vzm Nov 09 '13 at 20:28

1 Answers1

0

in view controller add this method

- (BOOL)prefersStatusBarHidden 
{
    return YES;
}
meth
  • 1,887
  • 2
  • 18
  • 33