How to change system navigation bar color

Starting from API 27, it is now possible to use the light style of the navigation bar:

<item name="android:navigationBarColor">@android:color/white</item>
<item name="android:windowLightNavigationBar">true</item>

From the documentation:

windowLightNavigationBar

If set, the navigation bar will be drawn such that it is compatible with a light navigation bar background.

For this to take effect, the window must be drawing the system bar
backgrounds with windowDrawsSystemBarBackgrounds and the navigation
bar must not have been requested to be translucent with
windowTranslucentNavigation. Corresponds to setting
SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR on the decor view.

Leave a Comment