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.
to make the StatusBar transparent, use backgroundColor={'transparent'} and translucent={true} options in StatusBar component of RN(React Native) like above.
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.
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!
Don't waste your time just do simple at the splash time/launch time status bar hide
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With