Home > Software design >  Android activity system navigation bar color?
Android activity system navigation bar color?

Time:08-22

I want to create a new Activity, with black system navigationbar color, like this: enter image description here

Manifest:

<activity
    android:name=".activity.MyActivity"
    android:exported="false"
    android:theme="@style/AppTheme.NoActionBar" />

styles.xml:

<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
    <item name="android:navigationBarColor">@color/colorBlack</item>
    <item name="android:windowTranslucentNavigation">false</item>
</style>

And the result: enter image description here

I also tried setting the color in the Activity with window.navigationBarColor = getColor(R.color.colorBlack), but it's not working...

What sould I do?

CodePudding user response:

You can try using sth like this:

<style name="AppTheme" parent="Theme.AppCompat">
    <item name="android:navigationBarColor">@color/my_color</item>
</style>

android:navigationBarColor should do the trick.

Here you have a thread regarding this topic: How to change system navigation bar color

  • Related