0

I'm trying to make the status bar color #a1a1a1 (white_dark) but it's just black when i run it.

This is my Style v21 file:

    <style name="AppBaseTheme" parent="AppTheme">
         <item name="android:windowDrawsSystemBarBackgrounds">true</item>
         <item name="android:statusBarColor">@color/white_dark</item>
    </style>
Noxious Reptile
  • 838
  • 1
  • 7
  • 24
Mike
  • 56
  • 2

2 Answers2

0

you can try this lib

But my personal suggestion is, switch to AppCompatbecause its very easy to change StatusBar color in it.

Primary Dark color is used for StatusBar:

<!-- darker variant for the status bar and contextual app bars -->
<item name="colorPrimaryDark">@android:color/black</item>
Akshay
  • 6,029
  • 7
  • 40
  • 59
0

use this theme

<resources>
    <!-- the theme applied to the application or activity -->
    <style name="CustomActionBarTheme"
        parent="@style/Theme.AppCompat.Light.DarkActionBar">
        <item name="android:actionBarStyle">@style/MyActionBar</item>

        <!-- Support library compatibility -->
        <item name="actionBarStyle">@style/MyActionBar</item>
    </style>

    <!-- ActionBar styles -->
    <style name="MyActionBar"
        parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
        <item name="android:background">@color/atctionbar_color</item>

        <!-- Support library compatibility -->
        <item name="background">@color/atctionbar_color</item>
    </style>
</resources>

and create new file in values>colors.xml and add color from there

<resources>
    <color name="atctionbar_color">#170053</color>
</resources>
Amar Yadav
  • 170
  • 11