开发者

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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜