Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change navigation bar color

I know it is possible since API 21 to change the color of the navigation bar. I have looked at the documentation of React Native but I can not find a way to do this.

The only way I know is by creating a native module, but that does not seem like a good solution since I am using Expo.

Is there a built-in way to do this?

like image 490
Joery Avatar asked Aug 28 '17 22:08

Joery


2 Answers

(For those using react-native-cli) Just add <item name="android:navigationBarColor">#0D0D0D</item> to your style in android/app/src/main/res/values/styles.xml like:

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:textColor">#000000</item>
    <item name="android:navigationBarColor">#0D0D0D</item> <!--  ADD THIS LINE TO YOUR styles.xml    -->
</style>
like image 187
M_droid Avatar answered Oct 08 '22 01:10

M_droid


Well I had made one plugin for that it is use full to achieve what you want.

https://github.com/BhavanPatel/react-native-navbar-color

https://www.npmjs.com/package/react-native-navbar-color

like image 40
Bhavan Patel Avatar answered Oct 08 '22 00:10

Bhavan Patel