1

My menu layout looks like this:

<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/action_change_pin"
    android:title="@string/action_change_pin"
    android:textColor="#000000"
    android:orderInCategory="100"
    app:showAsAction="never" />
<item android:id="@+id/action_logout"
    android:title="@string/action_logout"
    android:orderInCategory="100"
    app:showAsAction="never" />

I want to change these two items' text color to white from black. How can i do that?

  • Check [this](http://stackoverflow.com/questions/3519277/how-to-change-the-text-color-of-menu-item-in-android) out – Strider Feb 11 '16 at 08:00
  • I don't understand a bit about themes, I have styles.xml. In which there are a lot of themes, in which one do I have to apply this line: @color/your_color – Mindaugas Nakrošis Feb 11 '16 at 08:05

3 Answers3

1

I think u need to change the style: try this :

put this in your theme

 <item name="android:itemTextAppearance">@style/myCustomMenuTextApearance</item>

and in your styles.xml:

<style name="myCustomMenuTextApearance" parent="@android:style/TextAppearance.Widget.IconMenu.Item">
    <item name="android:textColor">@color/your_color</item>
</style>

should help u out

Strider
  • 4,452
  • 3
  • 24
  • 35
1

In your theme.xml

<style name="LightTheme" parent="@style/Theme.AppCompat.Light">
    <item name="actionMenuTextColor">#FFF</item>
    <item name="android:actionMenuTextColor">#FFF</item>
</style>
Venkatesh
  • 209
  • 2
  • 11
0

Try this:

    <style name="ThemeName" parent="@style/Theme.Sherlock.Light">
         <item name="actionMenuTextColor">@color/white</item>
         <item name="android:actionMenuTextColor">@color/white</item>
    </style>
Kostas Drak
  • 3,222
  • 6
  • 28
  • 60