Arcanelab Blog
text

Custom title bar right from the app launch Sometimes the devtools don’t follow exactly…

Custom title bar right from the app launch

Sometimes the devtools don’t follow exactly the same logic that we, developers do. For example, when I wanted to change the color of the title bar (we are talking about iPhone development, by the way :-]), setting the corresponding values in Interface Builder didn’t achieve the desired effect. I tried to change the title bar style both in the view and window attributes but to no avail.

In such situations comes handy the manual value-setting from code. However, by setting the title bar color from code, at startup we can grasp the moment when the default color gets quickly replaced by our color, which is not a nice thing to see. To overcome this problem, we can also use an other way to set that color: in the info.plist file.

As I learned this trick from a forum-thread, just add the key UIStatusBarStyle with the following value: UIStatusBarStyleOpaqueBlack to set the title bar to opaque black, for example.

And now, enjoy your new title bar. :)