我想在 longclick 上更改我的自定义列表视图的背景颜色。这是我的选择器,但只运行 onClick。我能做些什么 ?
*表行选择器.xml*
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true"
android:drawable="#8D2EE4" />
<item android:state_activated="true"
android:drawable="@color/ThemeBlue" />
<item android:state_activated="true" android:state_focused="false"
android:drawable="@color/ThemeBlue" />
<item android:state_pressed="true" >
<shape>
<gradient
android:startColor="#0266e9"
android:endColor="#0484f2"
android:angle="90" />
</shape>
</item>
<item android:state_focused="true" >
<shape>
<gradient
android:startColor="#bbccff"
android:endColor="#dce4fd"
android:angle="90" />
</shape>
</item>
<item>
<shape>
<solid android:color="#00000000"></solid>
</shape>
</item>
</selector>