Comments (11)
Despite the config, it looks like the status bar is in overlay mode. I took a quick look at the src code, and I think line 121 of CDVStatusBar.m is the fault.
I don't see at any point where the plugin on pluginInitialize obeys the config.xml value, and it appears hard code _statusBarOverlaysWebview = YES;
Does the problem persist if you programmatically turn overlay off by using StatusBar.overlaysWebView(false);
after the device ready event fires?
from cordova-plugin-statusbar.
@breautek That worked for me, so it seems you're right. Thanks so much for the help!
from cordova-plugin-statusbar.
@stefangroenew The javascript solution wasn't really a solution. More like a workaround. The real solution in my opinion is to fix the native objective-c code to pull in the preference values from config.xml. That is however outside of my knowledge. I'm not an experienced iOS developer, nor do I have a personal iphone or mac to use to test with.
from cordova-plugin-statusbar.
@stefangroenew Did you find any workaround to this? This has been a big problem for me with multiple apps. We've had to revert to earlier version of the Cordova CLI.
from cordova-plugin-statusbar.
@bvosk Unfortunately I have not found a solution yet. Which version of Phonegap Build do you use? Can you send the config.xml code snippet? Thanks!
from cordova-plugin-statusbar.
@stefangroenew Using this preference in the config.xml
file makes the status bar work for us:
<preference name="phonegap-version" value="cli-6.5.0" />
Note that this causes problems on Android, so we've been building different copies for iOS and Android.
from cordova-plugin-statusbar.
@breautek @bvosk Thank you for your comments, unfortunately the Javascript solution after the DeviceReady will not work (on IOS).
I have set a lime color that works well on Android.
StatusBar.overlaysWebView(false); StatusBar.backgroundColorByHexString("#adf907");
However, this does not work on IOS. The color is visible a verry short time. See this video:
https://youtu.be/RS_5hFCWHSU
Any idea? Thanks! Stefan
from cordova-plugin-statusbar.
@breautek @bvosk I found the issue! The Javascript solution was working but the framework I use was overwrite some settings. More info:
https://framework7.io/docs/statusbar.html#statusbar-styling
Thanks again for the help! Stefan
from cordova-plugin-statusbar.
@stefangroenew I agree with @breautek, would better to leave this open because it should respect the preference in the config.xml
file.
from cordova-plugin-statusbar.
I did a little bit more investigating and found that this isn't indeed only an iOS issue.
On Android, StatusBarBackgroundColor
, StatusBarStyle
both do appear to work on startup. StatusBarOverlaysWebView
however does not. Additionally Android does not use overlay mode by default, despite what the documentation says.
For android it appears to be an easy fix
cordova-plugin-statusbar/src/android/StatusBar.java
Lines 62 to 66 in adcee9f
We can see here it looks at the preference and sets up accordingly for the other preferences. But it doesn't do that for StatusBarOverlaysWebView
. It doesn't even set it to true by default like iOS does.
Makes me wonder if it is better to keep it false by default for android and make a note in the documentation rather than changing the behaviour and potentially causing unexpected changes for people.
from cordova-plugin-statusbar.
I can't reproduce on latest version of the plugin, cordova and cordova-ios.
The code for checking the preference has always been there according to the git blame
9 years ago https://github.com/apache/cordova-plugin-statusbar/blame/3795486e33a4a9113773d5e688374d142f93828c/src/ios/CDVStatusBar.m#L113-L115
7 years ago https://github.com/apache/cordova-plugin-statusbar/blame/1672883a7fda51e73069d6f350393bb2719228e3/src/ios/CDVStatusBar.m#L190-L196
As far as I remember phonegap build had a problem with preferences not working and some users mention phonegap build, so it was probably the issue.
If somebody still faces the issue with latest cordova, cordova-ios and cordova-plugin-statusbar, please, create a new issue and provide a sample app where the issue can be reproduced.
from cordova-plugin-statusbar.
Related Issues (20)
- Failed to fetch plugin cordova-plugin-statusbar@cordova-plugin-statusbar via registry. HOT 4
- Add success and error callbacks for the `overlaysWebView` method
- StyleDefault will set light text instead of dark. HOT 3
- Xcode 12 and iOS 9.0 various deprecation
- 2.4.3 BROKEN - Replacement Release Desperately Needed HOT 5
- iOS - HTML video player full screen causes web view overlay issues HOT 2
- Empty space below the status bar on devices without notch and iOS 15.4 HOT 5
- Webview doesn't take full height after hide
- Device elements overlap ionic header HOT 6
- On android 12, statusbar styleDefault method not work as expected
- iPhone 14 Pro floating island status bar height incorrect HOT 5
- Status bar background color overridden on Android 13 HOT 2
- backgroundColorByHexString does not work? HOT 2
- Plugin not working on Android 13 with cordova [email protected] HOT 10
- change statusBar background color and icon color for only one screen(Page) for iOS and android HOT 1
- Android top and bottom content overlapped by status bar after upgrade from 2.4.3 to 3.0.0 HOT 10
- StatusBar not changing Color on Android 13 HOT 7
- StatusBar still there, stopped to work HOT 1
- Playing video on iOS and shifting from landscape to portrait messes up status bar HOT 5
- Bottom nav bar overlaps webview in Android 13 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-plugin-statusbar.