Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phonegap - How do i make the statusbar black?

Tags:

iphone

cordova

Pretty simple one that I just seemingly can't find the answer to.

How can i change the iPhone statusbar (thin bar right at the top with the reception/batter etc) from default grey to black in my PhoneGap iPhone application?

Thanks, Glen

like image 625
Nelga Avatar asked Oct 29 '10 04:10

Nelga


2 Answers

A PhoneGap-iPhone application is just a regular Xcode iPhone project.

Add UIStatusBarStyle:UIStatusBarStyleBlackOpaque to your Info.plist.

  1. Open your Xcode project (e.g. MyApp.xcodeproj)
  2. Open your Info.plist file (e.g. MyApp-Info.plist)
  3. Add a new row:
    • Key: Status bar style
    • Value: Opaque black style

If you are viewing the RAW Key/Value pairs, then use:

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

You can right-click in MyApp-Info.plist to toggle the RAW Key/Value pairs.

like image 85
mwbrooks Avatar answered Nov 15 '22 12:11

mwbrooks


just set

[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlackOpaque;
like image 36
Gyani Avatar answered Nov 15 '22 13:11

Gyani