After adding StatusBarOverlaysWebview to config.xml, i get a white bar at the top of the screen and all the content is pushed down (see screenshot - there is a white bar on top of the statusbar). So instead of just adding the statusbar height (20px) to the screen, it adds 40px.
I double-checked all my styling and everything looks fine, so i guess its caused by the plugin somehow. Can anyone tell me how to solve this?
This is my config:
<preference name="StatusBarOverlaysWebview" value="false" />
<preference name="StatusBarBackgroundColor" value="#FF543E" />
<preference name="fullscreen" value="true" />
This is what it looks like without setting a color and using window.StatusBar.overlaysWebView(false); instead of config.xml
Plugin cordova-plugin-statusbar will help you achieve what you want to do. After adding plugin add following preference in config.xml to get black background Available values are default, lightcontent, blacktranslucent, blackopaque.
In order to change the iOS status bar of your progressive web app, you must use the apple-mobile-web-app-status-bar-style meta tag. Unfortunately, the number of ways to customize the status bar is fairly limited, but Apple offers three distinct settings: default, black, and black-translucent.
How to Show/ Hide the Status Bar in Ionic Application? After checking if it is visible by using the inVisible () method We can call the overlaysWebView method which takes a boolean to hide the overlap when to show apps in full screen.
The default setting has a white background with black text and symbols. The black setting has a black background and black text and symbols, making it appear completely black. If you do not use the status bar meta tag, this is what status bar will look like.
Try this, below code is working for me:
<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="StatusBarBackgroundColor" value="#2D81C1" />
<preference name="Fullscreen" value="false" />
if you still have problem and if the same code was working for you in the previous builds, please check if plug in is installed and working properly
Update: For iOS 11 and iPhone X there are some changes in the library and HTML meta tags
In index.html change meta tag to this:
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
Please update ionic-angular library also for the latest devices support
More information here: iOS 11 ionic checklist
This appears to be a bug with the way Cordova handles iOS 11's statusbar. As a fix, you can put
<meta name="viewport" content="viewport-fit=cover">
in your index.html.
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