Android selector - Text color
the background of a button is set based on selectors defined as:
<selector xmlns:android="http://schemas.android.com/apk/res/android" android:dither="true">
<item android:state_checked="true" android:drawable="@drawable/checked" />
<item android:state_focused="true" android:drawable="@drawable/focused" />
<item android:drawable="@drawable/normal"/>
</selector>
How do I define the button's text color based on its state (pressed / focused)? This doesn't work:
<selector xmlns:android="http://schemas.android.com/apk/res/and开发者_开发技巧roid" android:dither="true">
<item android:state_checked="true" android:drawable="@drawable/checked" android:textColor="#CCCCCCCC"/>
</selector>
精彩评论