Cordova NavigationBar Plugin
npm install cordova-plugin-navigationbar-color> The NavigationBar object provides some functions to control the Android device navigation bar.
cordova plugin add cordova-plugin-navigationbar-color
Preferences
-----------
#### config.xml
- __NavigationBarBackgroundColor__ (color hex string, default value __#000000__). Color of navigation bar.
``xml`
- __NavigationBarLight__ (boolean, defaults to __false__). Change the color of the buttons in the navigation bar to black, use in light colors of the navigation bar (Android 8.0 or higher).
`xml`
Methods
-------
This plugin defines global NavigationBar object.
Although in the global scope, it is not available until after the deviceready event.
`js
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady()
{
console.log(NavigationBar);
}
`
#### NavigationBar.backgroundColorByHexString
Set color of navigation bar by hex string.
`js`
NavigationBar.backgroundColorByHexString(String colorHex, Boolean lightNavigationBar = false);
- __colorHex__ Color hex string. Set the color of navigation bar.
- __lightNavigationBar__ Change the color of the buttons in the navigation bar to black, use in light colors of the navigation bar (Android 8.0 or higher).
#### NavigationBar.backgroundColorByName
Set color of navigation bar by color name.
`js`
NavigationBar.backgroundColorByName(String colorName, Boolean lightNavigationBar = false);
- __colorName__ Color name. Set the color of navigation bar.
- - __Possible values__
- - black: Equals #000000darkGray
- - : Equals #A9A9A9lightGray
- - : Equals #D3D3D3white
- - : Equals #FFFFFFgray
- - : Equals #808080red
- - : Equals #FF0000green
- - : Equals #00FF00blue
- - : Equals #0000FFcyan
- - : Equals #00FFFFyellow
- - : Equals #FFFF00magenta
- - : Equals #FF00FForange
- - : Equals #FFA500purple
- - : Equals #800080brown
- - : Equals #A52A2A
- __lightNavigationBar__ Change the color of the buttons in the navigation bar to black, use in light colors of the navigation bar (Android 8.0 or higher).
#### NavigationBar.hide
Hide the navigation bar.
`js`
NavigationBar.hide();
#### NavigationBar.show
Shows the navigation bar.
`js``
NavigationBar.show();