Friday, June 27, 2008

Hide Status Bar

This is how to hide the status bar in iPhone. For the Open toolchain api is available. However, for Official SDK API, edit the Info.plist is necessary.


Official iPhone OS 2.0 SDK headers version


Info.plist : Select all

<key>UIStatusBarHidden</key>
<true />

or. programmatically,

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


Open Tool Chain headers version


Hello.app : Select all


[UIHardware _setStatusBarHeight:0.0f];
[self setStatusBarMode:2 duration:0.0f];
[self setStatusBarHidden:YES animated:NO]; // hide status bar

12 comments:

Unknown said...

Thanks! that post rocked my morning. It's the little perks...

Anonymous said...

Great! The info.plist method didn't do anything for me, but putting the setStatusBarHidden:YES line into applicationDidFinishLaunching did the trick for me. (iPhone OS 2.2.1)

Unknown said...

it seems this method can't be run in os 3.0 beta4......

Anonymous said...

Thank you anonymous for mentioning where that the line went into applicationDidFinishLaunching

It did nothing until I put it in the right place. :)

Unknown said...

info.plist approach works also -- when editing in XCode enter value of 1 for UIStatusBarHidden key rather than true.

Sergio said...

Thanks for the tip. For me it worked better modifying the info.plist file, than adding the line to applicationDidFinishLaunching. The latter would show it first and then hide it.

Anonymous said...

if you do UIStatusBarHidden, make sure to control click the value column and change the type to boolean. Then make sure the value is checked (=true)

Anonymous said...

FWIW, setting it with the code left the status bar showing during the thumbnail zoom (at least in my simulator) using the info.plist entry it doesnt appear in the thumb zoom either. (sorry, i dont know what that thing should be called... the app start animation)

OS 3.1.3

Anonymous said...

whew, finally know how to get that anyoning status bar out of the way!

Anonymous said...

Thanks! I was trying to figure out how to do this.

Note: setStatusBarHidden animated has been deprecated. Use this instead:

[application setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];

Paul Michael said...

Thanks! Forgot how to do this and Google Search brought me to your blog. :)

yunas said...

thank you thank you and thannnnnk you :)