Cordova, how to change the color of the control bar: back, home and windows

1

I'm not sure the name of the component but the image below clarifies what I need, I apologize right now ...

I need to change the color of this component on the cord

    
asked by anonymous 07.03.2017 / 14:41

1 answer

2

Since Apache Cordova turns HTML5 + CSS + JavaScript into native code, you will have to make an adaptation of the original code basic color change for NavigationBarColor . Here are two ways, both XML and programmatically, using JAVA. See:

XML

<item name="android:navigationBarColor">@color/theme_color</item>

JAVA

window.setNavigationBarColor(@ColorInt int color)

However there are some plugins that you may be using. For example, the cordova-plugin-navigationbar-color . Because it is open source, you can study and adapt it according to your needs. Here's how it would look:

window.NavigationBar.backgroundColorByHexString('#3F51B5');

Note : The method was introduced in Android Lollipop and will not work in the < 21.

    
07.03.2017 / 15:20