第二次点击后列表选择不会消失
我有一个 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>
grey_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>
重现此问题的步骤:
- 列出项目
- 触摸并按住任何项目
- 使用其他手指触摸并按住任何其他项目
- 移开保留步骤 2 中选项的手指
- 继续将步骤 3 中的手指放在屏幕上,然后向下滑动,直到出现 屏幕结束
同时选择两个项目后,突出显示始终保留,并且应该消失。使用没有 android:background
值的项目无法重现此问题。会不会是Android平台的问题?
I have a ListView or PreferenceView with some items (5 for ex.)
and each element has android:background
value
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>
Steps to reproduce this issue:
- List item
- Touch and hold any item
- Touch and hold any other item using other finger
- Remove finger which keeps option from step 2
- Continue keep your finger from step 3 on the screen and swipe down until the
end of screen
Highlighting always remains after selecting two items at the same time and should be disappeared. This issue cannot be reproduced with items without the android:background
value. Could it be an Android platform issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论