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:
Thanks! that post rocked my morning. It's the little perks...
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)
it seems this method can't be run in os 3.0 beta4......
Thank you anonymous for mentioning where that the line went into applicationDidFinishLaunching
It did nothing until I put it in the right place. :)
info.plist approach works also -- when editing in XCode enter value of 1 for UIStatusBarHidden key rather than true.
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.
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)
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
whew, finally know how to get that anyoning status bar out of the way!
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];
Thanks! Forgot how to do this and Google Search brought me to your blog. :)
thank you thank you and thannnnnk you :)
Post a Comment