How to change text color of menu item title. I tried to change it as below

<style name="Theme.Kanku.ActionBar.TitleTextStyle" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
    <item name="android:textColor">@color/white</item>
</style>

But it change color only of Action Bar title text, but not menu item text.


Try something like this :

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

I tried several things but nothing worked for me. Finally this did the trick:

<style name="your_theme" parent="your_parent">
    <item name="android:itemTextAppearance">@style/TextAppearance</item>
</style>

<style name="TextAppearance">
    <item name="android:textColor">@android:color/black</item>
</style>

I didn't use Sherlock themes. This worked for Holo.Light.DarkActionBar.


After trying all of these and having them not work, I went about it programmatically like this:

public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.changeip_card_menu, menu); 
    for(int i = 0; i < menu.size(); i++) {
        MenuItem item = menu.getItem(i);
        SpannableString spanString = new SpannableString(menu.getItem(i).getTitle().toString());
        spanString.setSpan(new ForegroundColorSpan(Color.WHITE), 0, spanString.length(), 0); //fix the color to white
        item.setTitle(spanString);
    }
    return true;
}

This will work dynamically every time. In this case, the text color is changed to white. Simpy, change Color.WHITE to Color.whatever-color-you-want to change it to whatever color you want.


To update the menu item text color you need to make changes in themes.xml. The following answer is for sherlock.actionbar. In your themes.xml file add following lines:

<style name="Theme.Mytheme" parent="@style/Theme.Sherlock">
    <item name="actionMenuTextColor">@color/mycolor</item>     
    <item name="android:actionMenuTextColor">@color/mycolor</item>
</style> 

this worked for me:

<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
    <item name="android:textAppearanceLargePopupMenu">@style/MyOverflowItemCollor</item>       
</style>

<style name="MyOverflowItemCollor" parent="android:TextAppearance.Holo.Widget.PopupMenu.Large">
    <item name="android:textColor">#ffffff</item>
</style>