How to get a black status bar on an iPhone app?

14,634

Solution 1

  1. Open the "info.plist" file .
  2. Add a new row.
  3. Select "Status bar style" as the key.
  4. Select "Opaque black style" as the value.

EDIT: The comment by @codrut below to choose the value:
If you go far to the right, there's a button that brings you a drop down with the possible options.

Solution 2

The status bar in the nib files is there as an indication, just to simulate the real interface. What you need to do is:

 [[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleBlackOpaque];

and in the plist change the Status Bar Style (UIStatusBarStyle) to Black opaque (UIStatusBarStyleBlackOpaque) (or whatever you want).

Solution 3

Add the following in the info.plist file

<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleBlackOpaque</string>

Solution 4

Not sure if this will help anyone else, but in our app we ran into an issue where the only way we could get it to use the black style was if we set it to the default style:

[[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleDefault];

Might be worth giving that a try if BlackOpaque isn't working for you.

Solution 5

Try this simple method....

1.For single viewController

[[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleBlackOpaque];

2.For whole application

info.plist
      ----> Status Bar Style
                  --->UIStatusBarStyle to UIStatusBarStyleBlackOpaque
Share:
14,634
Jackelope11
Author by

Jackelope11

(Your about me is currently blank. )

Updated on June 07, 2022

Comments

  • Jackelope11
    Jackelope11 almost 2 years

    I want to use a black status bar for my iPhone app. I have selected black status bar on all of my .xibs but I still can't get it to be black. Is this an issue that anyone else has seen or knows how to remedy?

  • Dmitry
    Dmitry almost 12 years
    info.plist more better on application start.
  • Ahmed
    Ahmed over 11 years
    Well I reached to Status bar style myself but wouldn't ever have figured out to write 'Opaque black style' as the value. Thanks for saving...
  • codrut
    codrut over 11 years
    @Ahmed if you go far to the right, there's a button that brings you a drop down with the possible options