Change Android Navigation Bar Icon Color Guide
In this article
Yes—you can change the Android navigation bar icon color by enabling the light‑navigation‑bar mode in the system UI or, for developers, by calling the appropriate WindowInsetsController methods.
What You'll Need
- An Android device running Android 10 (API 29) or newer. Earlier versions do not expose a built‑in option for icon color.
- Access to the device Settings app, or a development environment (Android Studio) if you prefer a programmatic solution.
- Optional: A code editor and a basic understanding of Android activity lifecycle when using the code method.
Step‑by‑Step
- Open Settings. From the home screen, swipe down from the top and tap the gear icon, or locate the Settings app in the app drawer.
- Navigate to Display settings. The exact path may vary: on most devices it is Settings > Display. Look for an option named Navigation bar, System navigation, or Advanced within Display.
- Find the Light/Dark navigation bar toggle. Newer Android skins (Pixel UI, One UI, OxygenOS, etc.) expose a switch called Light navigation bar or Use light navigation bar icons. Turning this on changes the icons to a dark (black) color, which is visible on a light‑colored background. Turning it off makes the icons light (white) for dark backgrounds.
- Choose a background color. Still in the Display or Navigation bar section, you may see a Navigation bar color picker. Select a light shade (e.g., white or pastel) if you have enabled the light‑navigation‑bar mode, or a dark shade if you kept the default dark icons.
- Apply and verify. Exit Settings. The navigation bar should instantly update. Press the back, home, and recent‑apps buttons to confirm the icons are now the desired color.
-
Programmatic alternative (for app developers). Open your Android project in Android Studio and add the following code inside
onCreate()of the activity you want to affect:
This call tells the system to render navigation‑bar icons in a dark color. To revert to light icons, replace the second argument withWindowInsetsController insetsController = getWindow().getInsetsController(); if (insetsController != null) { // true = light icons (suitable for dark background) // false = dark icons (suitable for light background) insetsController.setSystemBarsAppearance( WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS, WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS); }0. -
Set a matching navigation bar background. Still in
onCreate(), you can change the bar color with:
Choose a light color if you used the dark‑icon appearance, or a dark color for light icons.getWindow().setNavigationBarColor(ContextCompat.getColor(this, R.color.my_nav_bar)); - Test on multiple devices. Some OEM skins ignore the appearance flag or provide their own proprietary API. Run the app on a Pixel, Samsung, and OnePlus device to ensure consistent results.
- Deploy. Once verified, build and publish the app as usual. Users will see the navigation‑bar icon color change automatically when they open the activity.
Common Mistakes
- Assuming the setting exists on Android 9 or earlier. The system UI flag for light navigation bars was introduced in Android 10.
- Changing only the background color but forgetting to toggle the light‑navigation‑bar switch, leaving icons invisible against a similar‑shade background.
- Using
setSystemUiVisibility()with deprecated flags such asView.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BARon API levels that no longer support them. - Calling
setSystemBarsAppearance()without checking fornullongetInsetsController(), which can cause aNullPointerExceptionon some OEM‑modified builds. - Hard‑coding a color resource that is not defined for dark mode, causing the bar to appear black in night‑mode configurations.
Tips
- Use
isLightNavigationBars()(API 30) to query the current state before toggling, so you can create a user‑controlled switch inside your app. - Combine the navigation‑bar color change with
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARSfor a fully light‑themed system UI. - When supporting dynamic theming, store the preferred bar color in
SharedPreferencesand apply it inonResume()to handle configuration changes. - If your app uses fullscreen immersive mode, remember to re‑apply the appearance flags after calling
systemUiVisibility = View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY. - Test with the Android Accessibility Scanner; a mismatched icon/background contrast can trigger a warning for low visibility.
Troubleshooting
If the icons do not change after toggling the setting:
- Restart the device. Some OEM skins apply the change only after a reboot.
- Check for a system update. Manufacturers occasionally fix UI bugs that ignore the light‑navigation‑bar flag.
- Verify that you are on Android 10 or newer. On older versions the toggle is hidden, and the programmatic flag is ignored.
If the programmatic approach does not work:
- Ensure you are calling the code after
setContentView()and before any fullscreen flags are set. - Confirm that
getWindow().getInsetsController()returns a non‑null value. If it is null, the device’s window may not support the controller (e.g., some TV devices). - Make sure the
android:exportedattribute is set correctly in the manifest if you are using a separate activity to change UI appearance. - Check for OEM‑specific overlays. Samsung’s One UI, for instance, may require the
android:windowLightNavigationBarattribute in the theme XML as a fallback.
If you experience a sudden change back to white icons after a system update:
- Re‑apply the appearance flag in
onResume()rather than only inonCreate(), because the system may reset UI flags when the activity is recreated. - Clear the app’s cache via Settings > Apps > YourApp > Storage > Clear cache. Corrupt cache data can sometimes prevent the flag from persisting.
Frequently Asked Questions
Can I change the navigation bar icon color on Android 9 or lower?
No. Android 9 and earlier do not expose a system UI flag for light navigation bars, so the icon color cannot be changed without rooting or using a custom ROM.
Do all Android manufacturers support the light‑navigation‑bar setting?
Most stock Android skins (Pixel, Android One) support it. Some heavily customized OEM skins may hide the toggle or ignore the flag, requiring the developer‑side approach or a device‑specific setting.
Will changing the navigation bar color affect battery life?
No. The change only alters the color of UI elements drawn by the system compositor and does not impact power consumption.
Is there a way to let users toggle the icon color inside my app?
Yes. Expose a switch that calls WindowInsetsController.setSystemBarsAppearance() with the appropriate flag, and store the preference so it persists across launches.
What if my app runs in fullscreen immersive mode?
When you hide the navigation bar, the system may restore default appearance flags when the bar re‑appears. Re‑apply the appearance flag each time you call show() on the WindowInsetsController.
Can I set a gradient as the navigation bar background?
The navigation bar accepts only solid colors via setNavigationBarColor(). Gradients are not supported by the system UI.