Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 906
gokujou Avatar asked Jan 28 '14 01:01

gokujou


People also ask

How do I hide status bar in splash screen react native?

to make the StatusBar transparent, use backgroundColor={'transparent'} and translucent={true} options in StatusBar component of RN(React Native) like above.

How to remove splash screen in cordova?

iOS Quirk: to disable the splashscreen on ios platform you should also add <preference name="FadeSplashScreenDuration" value="0"/> to config. xml . FadeSplashScreen (boolean, defaults to true ): Set to false to prevent the splash screen from fading in and out when its display state changes.


4 Answers

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!

like image 81
gokujou Avatar answered Oct 16 '22 22:10

gokujou


Don't waste your time just do simple at the splash time/launch time status bar hide

enter image description here

like image 34
codercat Avatar answered Oct 16 '22 23:10

codercat


Status Bar

To remove the status bar in iOS 7 use the following entries in the plist file.

<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>

In the configuration on XCode the following achieves the same

set Status bar is initially hidden = YES
add row: View controller-based status bar appearance = NO
like image 43
Ian Warner Avatar answered Oct 16 '22 21:10

Ian Warner


Updated:

We can also inject the info.plist directly from config.xml.

<config-file parent="UIStatusBarHidden" platform="ios" target="*-Info.plist">
    <true />
</config-file>
<config-file parent="UIViewControllerBasedStatusBarAppearance" platform="ios" target="*-Info.plist">
     <false />
</config-file>

The first config will hide the status bar on the splash/lunch screen. The second config will hide the status bar after the splash/lunch screen.

like image 21
Pyae Sone Avatar answered Oct 16 '22 21:10

Pyae Sone