Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove iOS status bar with Phonegap Build?

Tags:

Is it possible to get rid of the status bar in iOS7 when using Phonegap Build 3.1? I can remove the status bar when building locally in Xcode, but as soon as I try Phonegap Build, it's back again.

  1. Is there a config preference to remove the status bar completely?
  2. If not, is it possible to overlay the status bar on top of the app view and set it to a transparent background?

I do not want the status bar to push down the app view 20px, which is the case now.

like image 931
Per Quested Aronsson Avatar asked Dec 22 '13 21:12

Per Quested Aronsson


2 Answers

As of Phonegap 3 you can now customize plist files via config.xml.

Code:

<gap:config-file platform="ios" parent="UIViewControllerBasedStatusBarAppearance" overwrite="true">     <false/> </gap:config-file> 
like image 70
Minifyre Avatar answered Sep 25 '22 10:09

Minifyre


Usually, you would edit the info.plist and add this key:

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

But as you can't do this on build, you'll have to add a plugin:

https://github.com/phonegap-build/StatusBarPlugin/blob/master/README.md

And then:

StatusBar.hide();

like image 20
MPaulo Avatar answered Sep 22 '22 10:09

MPaulo