Cordova: How do you hide the status bar on the splash/launch screen?

gokujou picture gokujou · Jan 28, 2014 · Viewed 10.9k times · Source

I am trying to remove the status bar across my app with Cordova. I have tried <preference name="Fullscreen" value="true" /> but it looks like in iOS7 that does not work. (And iOS6 it left a black gap instead.)

I have since been using the StatusBar plugin and just firing StatusBar.hide(); at device ready, but this will not hide the status bar on the launch screen. Is there a way to hide the status bar across the entire app in iOS7 and not have to rewrite it each time I do a cordova build? Thank you.

Answer

gokujou picture gokujou · Jan 28, 2014

It is not the full answer that makes Cordova do it automatically. But I went into my .plist file for the iOS build and added:

UIStatusBarHidden = true
UIViewControllerBasedStatusBarAppearance = false

This makes it behave the correct way and is not getting overwritten by Cordova when I do a build so it will work for now.

If anyone finds or knows of a better way to enforce these settings, feel free to post it and I will either update this answer or choose yours next time I notice it. Thank you!