pypmannetjies
pypmannetjies

Reputation: 31224

ActionBar overflow icon refuses to change

I have been trying to change the overflow icon (the three dots) in the actionbar to just be white instead of gray. I have followed everyone's recommendations but it stays the same. Here is my code:

<style name="ActionBar.AccentColor.Background" parent="@android:style/Widget.Holo.ActionBar.Solid">
    <item name="android:actionOverflowButtonStyle">@style/MyActionButtonOverflow</item>
    <item name="android:background">@color/accent_dark</item>
    <item name="android:backgroundSplit">@color/accent_dark</item>
    <item name="android:titleTextStyle">@style/ActionBar.TitleTextStyle</item>
</style>

<style name="MyActionButtonOverflow" parent="android:style/Widget.Holo.Light.ActionButton.Overflow">
    <item name="android:src">@drawable/ic_action_back_white</item>
    <item name="android:background">?android:attr/actionBarItemBackground</item>
    <item name="android:contentDescription">"Lala"</item>
</style>

<style name="Theme" parent="@android:style/Theme.Holo.Light">
     <item name="android:actionBarStyle">@style/ActionBar.AccentColor.Background</item>
</style>

I have even created a new app and that works 100%. One idea was that perhaps the apklib project I was including was causing the problem, so I moved everything out of the apklib and tested again. No idea what is happening!

Upvotes: 2

Views: 2477

Answers (1)

Tomik
Tomik

Reputation: 23977

You have misplaced android:actionOverflowButtonStyle item. It has to be defined in the theme, not inside android:actionBarStyle.

Change the styles to the following, it should work:

<style name="ActionBar.AccentColor.Background" parent="@android:style/Widget.Holo.ActionBar.Solid">
    <item name="android:background">@color/accent_dark</item>
    <item name="android:backgroundSplit">@color/accent_dark</item>
    <item name="android:titleTextStyle">@style/ActionBar.TitleTextStyle</item>
</style>

<style name="MyActionButtonOverflow" parent="android:style/Widget.Holo.Light.ActionButton.Overflow">
    <item name="android:src">@drawable/ic_action_back_white</item>
    <item name="android:background">?android:attr/actionBarItemBackground</item>
    <item name="android:contentDescription">"Lala"</item>
</style>

<style name="Theme" parent="@android:style/Theme.Holo.Light">
     <item name="android:actionBarStyle">@style/ActionBar.AccentColor.Background</item>
     <item name="android:actionOverflowButtonStyle">@style/MyActionButtonOverflow</item>
</style>

Upvotes: 10

Related Questions