How would one go about changing device navigation bar color in Codename one? I recently learned to change the color of the status bar, and I would like to do the same for the device's navigation bar.
Asked
Active
Viewed 44 times
1
-
What's the device navigation bar? The sidebar? Toolbar? Can you add a screenshot to clarify? In general you can use the component explorer in the simulator to go over all the elements on the form and see the UIID for each. At this point you can customize the color via CSS. – Shai Almog Jul 16 '22 at 03:53
-
I've edited the question and included an image. The bar at the base of the screen that contains the "menu", "home" & "back" buttons. While on some phones it hardware integrated, on others like my s8 it is software integrared. I noticed on some apps that I open, it changes to suit the app theme. So wanted to know how to do this in codename one. – Kyros Nox Jul 16 '22 at 08:14
2 Answers
1
This isn't an editable area, I'm sure there are ways to override that but it's probably not what you want. This is a part of the device control. The device determines the colors based on light/dark theme of application.
To make it work as dark you can use the build hint android.theme=Dark
otherwise it should take the color based on device mode.

Shai Almog
- 51,749
- 5
- 35
- 65
1
I found the solution by adding a color.xml file to the native android resources folder with the following line of code:
android/src/main/resources/colors.xml
<resources>
<color name="navigationBarColor">#ff000000</color>
</resources>
With this line of code, the navigation bar is rendered "black".
Refernces:

Kyros Nox
- 173
- 2
- 9