第二次点击后,列表选择不会消失

时间:2012-01-03 15:27:29

标签: android listview touch selection tap

我有一个带有一些项目的ListView或PreferenceView(例如5个) 每个元素都有android:background

android:background="@drawable/red_selector_list"

red_selector_list:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_selected="true" android:drawable="@drawable/red_gradient" />
    <item android:state_focused="true" android:drawable="@drawable/red_gradient" />
    <item android:state_pressed="true" android:drawable="@drawable/red_gradient" />
    <item android:drawable="@drawable/gray_gradient_list" />
</selector>

red_gradient:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <gradient 
        android:angle="90" 
        android:startColor="#990000"
        android:centerColor="#b00000" 
        android:endColor="#ff0000" 
        android:type="linear" />
    <corners android:radius="0dp"/>
</shape>

gray_gradient_list:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <gradient android:angle="90" android:startColor="#ebebeb"
        android:endColor="#ffffff" android:type="linear" />
    <corners android:radius="0dp"/>
</shape>

重现此问题的步骤:

  1. 列表项
  2. 触摸并按住任何项目
  3. 使用其他手指触摸并按住任何其他项目
  4. 删除保留第2步选项的手指
  5. 继续将手指从屏幕上的第3步开始,然后向下滑动直至显示屏幕 屏幕结束
  6. 在同时选择两个项目后始终保持高亮显示并且应该消失。对于没有android:background值的项目,无法重现此问题。它可能是Android平台问题吗?

0 个答案:

没有答案
相关问题