背景颜色通过结合shape实现
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true">
<shape>
<solid android:color="@color/mostBg"></solid>
</shape>
</item>
<item android:state_checked="false">
<shape>
<solid android:color="@android:color/transparent"></solid>
</shape>
</item>
</selector>
字体颜色 如下:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true" android:color="#f00"/>
<item android:color="@android:color/black"/>
</selector>