Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Skin Options Menu Android

I'm trying to skin the options menu on android. I have the background color changed with a custom theme, but I can't get the text color to change for some reason.

My Theme

<style name="default" parent="@android:style/Theme.NoTitleBar">

    <!--  Menu panel colors -->
    <item name="android:panelBackground">@color/optionsMenuBackgroundColor</item>
    <item name="android:panelFullBackground">@color/optionsMenuBackgroundColor</item>

    <!--  Menu item colors -->
    <item name="android:itemTextAppearance">@style/OptionsMenuFont</item>

 </style>

My Style for the options menu font

<style name="OptionsMenuFont" parent="@android:style/TextAppearance.Widget.IconMenu.Item">
    <item name="android:textColor">@drawable/menu_item_font</item>
</style>

My drawable for the button color selector menu_item_font.xml

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >

    <!--  Put other state colors up top -->


    <item android:color="@color/optionsMenuTextColor" />

</selector>

That color is just a hex color #c4c4c4

What am I missing here?

like image 438
codeetcetera Avatar asked Feb 16 '12 21:02

codeetcetera


1 Answers

You can change the text color but it should go under the textColor tag. You can't put a drawable in any textColor (neither in styles, nor in layouts). If you want to change the color, change your style to this:

<style name="OptionsMenuFont" parent="@android:style/TextAppearance.Widget.IconMenu.Item">
    <item name="android:textColor">#c4c4c4</item>
</style>
like image 99
Zinc Avatar answered Sep 19 '22 13:09

Zinc