Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to quickly switch the status bar background style when an application is started?

This might be a bit difficult to explain in writing, so please bear with me here.

Whenever I wanted to customize the style of the status bar to the "dark" one, I simply add the following line to my AppDelegate's -applicationDidFinishLaunching: method:

[application setStatusBarStyle:UIStatusBarStyleBlackOpaque];

This works great, but there is a noticeable delay in changing that status bar to this dark style when the application launches. I can understand that, as the application has not completely launched yet.

However, there are a few applications out there that know a trick to make the status bar show up with the dark style instantly, right when the application launches and with no noticeable delays. One of them is Puzzlotto.

How can I do the same thing for my own application?

like image 320
jpm Avatar asked Nov 11 '08 17:11

jpm


1 Answers

You need to add a key to your info.plist to handle this:

<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleOpaqueBlack</string>
like image 166
Ben Gottlieb Avatar answered Oct 02 '22 21:10

Ben Gottlieb