我正在使用此代码表在不同事件中定义 textView 的颜色。textView 在 listView 中(10+ 项),效果(颜色)适用于每个 listItem 中的每个 textView。如何更改仅按下的 textView 的颜色?
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_focused="true"
android:state_pressed="true"
android:color="@color/text_white" />
<item
android:state_focused="false"
android:state_pressed="true"
android:color="@color/text_white" />
<item
android:state_focused="true"
android:color="@color/text_white" />
<item
android:state_selected="true"
android:color="@color/text_white" />
<item
android:state_checked="true"
android:color="@color/text_white" />
<item
android:state_selected="false"
android:state_checked="false"
android:state_focused="false"
android:state_pressed="false"
android:color="@color/text_blue" />
</selector>