There are several ways to change the color of the navigation bar.
<strong> values-V21 / style.xml
<item name="android:navigationBarColor">@color/navigationbar_color</item>
<strong> values ββ/style.xml
<resources xmlns:tools="http://schemas.android.com/tools"> <item name="android:navigationBarColor" tools:targetApi="21">@color/navigationbar_color</item>
You can also change the color of the navigation bar using Programming .
if (Build.VERSION.SDK_INT >= 21) getWindow().setNavigationBarColor(getResources().getColor(R.color.navigationbar_color));
Using the compatibility library -
if (Build.VERSION.SDK_INT >= 21) { getWindow().setNavigationBarColor(ContextCompat.getColor(this, R.color.primary)); }
Deepanshu Harbola Sep 04 '15 at 23:16 2015-09-04 23:16
source share