1

I've styled my action bar to change its background:

<style name="ColoredActionBar" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
    <item name="android:background">@color/main_background_color</item>
    <item name="background">@color/main_background_color</item>
</style>

<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light">
    <item name="actionBarStyle">@style/ColoredActionBar</item>
</style>

<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
</style>

(I placed different styles on values, values-v11 and values-v14).

I'm trying to change the menu background when state is pressed. I'm doing this:

<item name="actionButtonStyle">@drawable/actionbar_item</item>

and

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:state_pressed="true"
        android:drawable="@color/secundary_background_color" />
    <item
        android:drawable="@color/main_background_color" />
</selector>

but this is not working, it still the same.

How can I do this?

Thanks.

Maurício Giordano
  • 3,116
  • 4
  • 32
  • 60
  • The link may help you. http://stackoverflow.com/questions/19659637/how-to-change-the-background-color-of-action-bars-option-menu-in-android-4-2 – Gary Wong Aug 05 '14 at 00:22

0 Answers0