Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

styling ActionbarSherlock: textColor of the action-items

I was changing the background of the Actionbar in my App and to make text readable again I have to change the color of the text. I was successful with title/subtitle and the tab-texts, but I am struggling with the text of the action-items - they stay white no matter what I tried . Anyone has a hint on how to do that? Also the overflow-icon is white which does not look too good on the wooden background - is that an extremely good reason to use the stuff below? I am not really sure what's the reason to not do it, but as I do not have a big device-test-park I better want to be sure ;-)

<!-- the following can be used to style the overflow menu button
     only do this if you have an *extremely* good reason to!! -->
<!--<style name="MyOverflowButton" parent="Widget.Sherlock.ActionButton.Overflow">
    <item name="android:src">@drawable/ic_menu_view</item>
    <item name="android:background">@drawable/action_button_background</item>
</style>-->
like image 667
ligi Avatar asked Dec 03 '22 04:12

ligi


1 Answers

I also struggled with this, but the solution to changing action item text color was:

<style name="My.Theme" parent="Theme.Sherlock.Light">
    <item name="android:actionMenuTextColor">@android:color/white</item>
</style>

The key here was to use this attribute in the general theme, not in the actionbar style.

like image 192
zumpar Avatar answered Dec 05 '22 17:12

zumpar