Tobias Bambullis
Tobias Bambullis

Reputation: 249

How to set light-content style to status bar in a phonegap app?

I'm new to phonegap and i try to set the status bar to the new light-content ios7 style.

Is there a possibility to do that yet?

My status bar looks like that... enter image description here

... but I want to have this: enter image description here

Thanks so much for any help :-)

Upvotes: 9

Views: 12064

Answers (3)

benka
benka

Reputation: 4742

Open your info.plist (resources folder):

  • set: "View controller-based status bar appearance" to NO
  • set: "Status bar style" to "UIStatusBarStyleLightContent".

like this:

<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>

<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleLightContent</string>

Upvotes: 36

Tobias Bambullis
Tobias Bambullis

Reputation: 249

thanks for your answers. I've done everthing you wrote before, but it only takes effect on launchscreen, not in the app.

Finally I found the answer on StackOverflow, how to change the status bar style. In PhoneGap you can't do this at the moment I think.

Here is what I did to make it working: How to change Status Bar text color in iOS 7

Upvotes: 4

Siddhartha Gupta
Siddhartha Gupta

Reputation: 1168

Open the plist of the project as source code and add the following attributes

<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>

Also to set a custom color of status bar you can place the following code in AppDelegate.m - didFinishLaunchingWithOptions()

[[[[UIApplication sharedApplication] delegate] window] setBackgroundColor:[UIColor colorWithRed:0.8f green:0.8f blue:0.8f alpha:1]];
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

Not having screen shots right now, how bad :P.

Upvotes: 6

Related Questions