【发布时间】:2012-06-23 08:54:22
【问题描述】:
我正在尝试使用selector 突出显示listview 中的选定项目。
当我按下并移动时,一个项目会很好地突出显示。但是,如果我只是单击它,则该项目未突出显示。
这是我的选择器:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/item_focused" android:state_pressed="false" android:state_selected="false"/>
<item android:drawable="@drawable/item_focused" android:state_pressed="true"/>
<item android:drawable="@android:drawable/item_default" android:state_pressed="false" android:state_selected="true"/>
</selector>
我一直在调查这个问题,但我还没有找到解决方案。
【问题讨论】:
-
您在列表视图中使用了 android:listSelector 吗?
标签: android android-listview highlighting