Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IOS 4.3 hide status bar permanently

Tags:

ios

statusbar

I'm trying to hide the status bar in iOS 4.3 now that setStatusBarHidden:animated: is deprecated:

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

The only option that exists in the plist file is: Status bar is initially hidden. Which only hides the status bar at the start of the app.

Cheers

like image 330
user346443 Avatar asked Apr 18 '11 21:04

user346443


People also ask

How do I make the status bar disappear on my Iphone?

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.


2 Answers

Try this:

[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationFade];

From Apple Class Reference:

setStatusBarHidden:withAnimation:

Hides or shows the status bar, optionally animating the transition. - (void)setStatusBarHidden:(BOOL)hidden withAnimation:(UIStatusBarAnimation)animation Parameters

hidden YES to hide the status bar, NO to show the status bar.

animation A constant that indicates whether there should be an animation and, if one is requested, whether it should fade the status bar in or out or whether it should slide the status bar in or out.

like image 118
crimi Avatar answered Oct 09 '22 15:10

crimi


But how about [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];

See the UIApplication reference.

like image 8
Till Avatar answered Oct 09 '22 15:10

Till