Hiding the status bar fun

One issue a few iPhone game developers like me have run into is that for most games you want to have the status bar hidden. Now theoretically this is quite simple to do, by simply having UIStatusBarHidden ticked in your Info.plist settings.

And in fact, this was working for me, until at some point I made some other modifications to Info.plist and it the status bar suddenly started being shown. Looking around the net, I found other people mentioning the same problem. One solution mentioned was disabling the status-bar with the code:

[application setStatusBarHidden:YES animated:NO];

Now this code does works, but the problem with it is is that until the code is executed, the status bar shows – so your splash screen will come up with the status bar still showing, which is kind of ugly (you can still see this effect in some published apps/games).

The solution to my problem turned out to be that in editing Info.plist I’d somehow switched it from being in XML format to a key=value format file, and in this format the setting just wasn’t working (you can simply check by viewing Info.plist in any plain text viewer/editor). I converted it back to XML format, and voila, it worked again! Hope this helps some developers stuck with the exact same problem 🙂

Advertisements

2 Responses to “Hiding the status bar fun”

  1. Tim van Elsloo Says:

    Thank you for sharing this, this is exacty where I was searching for!

  2. CharlieH Says:

    Thanks for this helpful note. And for those looking to convert to XML, you can edit the Info.plist file and do a “Save As…” in Xcode, and change the file format to XML in that dialog (right above the Save button).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: