defining xml file for button to change background AND textColor based on state

eddio

New Member
I use this for my own button to set the background for state pressed and unpressed:\[code\]<?xml version="1.0" encoding="utf-8"?>\[/code\]\[code\]<item android:drawable="@drawable/btn1_pressed" android:state_pressed="true"/><item android:drawable="@drawable/btn1_unpressed"/> <!-- default -->\[/code\]But I also like the textColor to become white in state pressed.I tried to just add \[code\]textColor="#ffffff"\[/code\] to the item but I guess that's not the correct way, since it did not work.What would be the best approach without having to code it in each java file that uses this button?Thanks!
 
Back
Top