apache / cordova-plugin-statusbar

Apache Cordova Status Bar Plugin
https://cordova.apache.org/
Apache License 2.0
618 stars 480 forks source link

backgroundColorByHexString does not work? #254

Closed bublikOff closed 1 year ago

bublikOff commented 1 year ago

Trying to use status bar plugin with cordova@11

config.xml

    <preference name="StatusBarOverlaysWebView" value="false" />
    <preference name="StatusBarBackgroundColor" value="#ffa726" />

In html app Im trying to change color manually according to scroll position but have no luck. It keeps original #ffa726 color

if(cordova.platformId == 'android')
{
    StatusBar.backgroundColorByHexString(page.scrollTop > 30 ?  '#ffff' : '#ffa726');
}
jcesarmobile commented 1 year ago

Can you provide a sample app? #ffff is not a valid value, it should be 6 digits #ffffff or 3 digits #fff, but not 4.

bublikOff commented 1 year ago

My fault .. Cordova variable was overridden in app by local dummy data about Cordova