0

I have a gradient of two color in a shape and I wanted to put this in the actionBar of my application preferably in style because I want all the applicationbar to have this visual.

I try this

    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorAccent">@color/colorAccent</item>
        <item name="android:actionBarStyle">@style/AppTheme.ActionBar</item>
    </style>
    <style name="AppTheme.ActionBar" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
        <item name="android:background">@drawable/shape_toolbar</item>
    </style>

but failed

How I can do that?

Cœur
  • 37,241
  • 25
  • 195
  • 267

1 Answers1

0

You can switch to Toolbar instead of the standard ActionBar and then apply a style with android:background to it, almost the same as you did.

Can you make this changes by yourself? Here is a good guide about it: Codepath

Gaket
  • 6,533
  • 2
  • 37
  • 67