Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent iOS 5 from showing the status bar even though UIStatusBarHidden is YES?

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?

like image 623
dontWatchMyProfile Avatar asked Dec 23 '11 11:12

dontWatchMyProfile


People also ask

How do I turn off status bar on iPhone?

Go to Your info. plist file. Add a key called “View controller-based status bar appearance” and set its value to NO.

How do I hide my status bar on iPhone 7?

To completely hide it on the home screen, open up an app, such as Settings, and wait about three to four seconds. Press the home button again, and the status bar will be completely gone. The status bar will only be hidden on your home screen, so you'll still see it while using apps.

How do I get rid of status bar on IPAD?

You can hide just a few icons or all of them for no status bar at all. To do so, open the Settings app, then scroll down and select "HideStatusBarItems." Once inside, the first thing you'll want to do is enable HideStatusBarItem by putting the toggle next to "Enable Tweak" to the on position.


2 Answers

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.

like image 176
Mike K Avatar answered Sep 21 '22 20:09

Mike K


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

[[UIApplication sharedApplication]setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone]; 
like image 28
amunita Avatar answered Sep 21 '22 20:09

amunita