I am trying to get my buttons to change the color of their text when clicked, but I ran into a problem that I cannot solve. I get the error "Unable to resolve color value", after which it gives me the path to the file. here are my im files using
This file is located in a new folder called color under the resources and called button
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:color="#ffff0000" /> <item android:state_focused="true" android:color="#ff0000ff" /> <item android:color="#ff000000" /> </selector>
AND
<Button android:text="Main Menu" android:textColor="@color/button" android:layout_width="200px" android:id="@+id/mainmenu" android:layout_height="55px" android:layout_x="5dip" android:layout_y="174dip" android:textSize="18px"> </Button>
it drives me crazy if anyone can help me.
source share