Follow these steps
$ yarn add react-native-navigation-bar-color
2 - Configure package:
______________________________________________________________
======Open up android/app/src/main/java/[...]/MainApplication.java ======
== Add to the imports at the top of the file
(. import com.thebylito.navigationbarcolor.NavigationBarColorPackage;)
______
______________________________________________________________
======Append the following lines to android/settings.gradle:======
include ':react-native-navigation-bar-color'
project(':react-native-navigation-bar-color').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-navigation-bar-color/android')
______________________________________________________________
Insert the following lines inside the dependencies block in android/app/build.gradle:
implementation project(':react-native-navigation-bar-color')
Now restart the project
import changeNavigationBarColor, {
hideNavigationBar,
showNavigationBar,
} from 'react-native-navigation-bar-color';
========function list=========
const setNavigationColor = color => {
changeNavigationBarColor(color);
};
const hideNavigation = () => {
hideNavigationBar();
};
const showNavigation = () => {
showNavigationBar();
};
const testSetTranslucent = () => {
changeNavigationBarColor('translucent', false);
};
const testSetTransparent = () => {
changeNavigationBarColor('transparent', true);
};