Search code examples
androidkotlinstatusbar

The Status Bar of Android Project can not change color


Here's my themes.xml

<resources xmlns:tools="http://schemas.android.com/tools">
    <!-- Base application theme. -->
    <style name="Theme.ColorMyViews" parent="Theme.AppCompat.DayNight.DarkActionBar">
        <!-- Primary brand color. -->
        <item name="colorPrimary">#BE19FF</item>
        <item name="colorPrimaryVariant">#a100e0</item>
        <item name="colorOnPrimary">@color/white</item>
        <!-- Secondary brand color. -->
        <item name="colorSecondary">@color/teal_200</item>
        <item name="colorSecondaryVariant">@color/teal_700</item>
        <item name="colorOnSecondary">@color/black</item>
        <!-- Customize your theme here. -->
    </style>
</resources>

The Status Bar color is not changing no matter what I try! Please help!


Solution

  • The status bar color is based on the colorPrimaryDark value of the current theme.

     <item name="colorPrimaryDark">????</item>