1
Bearing in mind that the Apache Cordova transforms HTML5 + CSS + Javascript into native code, you will have to make an adaptation of the basic original code to change the color of the NavigationBarColor
. Below follows two forms, both via 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 in which you may be using. As for example, the Cordova-plugin-navigationbar-color. Since you are open source, you can study and adapt according to your needs. See how it would look:
window.NavigationBar.backgroundColorByHexString('#3F51B5');
Note: the method has been introduced into Android Lollipop and will not work in API version < 21.
interesting I will test
– Jefferson Mello Olynyki
could you cite an example of how to use ? in which xml I put this property, in config.xml ? , and meto there, is javascript ? how can I change to color : #3F51B5
– Jefferson Mello Olynyki
@Jeffersonmelloolynyki You came to install this plugin?
– viana
yes, I’ve installed it
– Jefferson Mello Olynyki
@Jeffersonmelloolynyki take a look at this file here, where the guy makes the change using the plugin: https://github.com/fagundes/cordova-plugin-navigationbar/blob/master/www/navigationbar.js
– viana
perfect @Ack Lay window.NavigationBar.backgroundColorByHexString('#3F51B5'); Thanks !
– Jefferson Mello Olynyki
@Jeffersonmelloolynyki edited the answer and put your code there because it can help other people. Abs. Good luck.
– viana
opa, beauty, it will help that you are with doubts, thank you
– Jefferson Mello Olynyki