Android的列表项重点亘古不留onItemLongclickListener [英] Android list item focus doesnot stay onItemLongclickListener
本文介绍了Android的列表项重点亘古不留onItemLongclickListener的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个列表视图项严重的问题。我的要求是当我的长上点击列表项或拖动列表项重点应该留下来。目前我使用下面的选择器列表项。但它不是给我的预期结果,并将焦点迷路
I have serious problem with listview item. My requirement is When I am long clicking on list item or dragging on list item the focus should stay. Currently I am using the following selector for list item. But It is not giving me the expected result and the focus is getting lost
<item android:state_pressed="true"
android:drawable="@drawable/detail_btn_frame_select" />
<item android:state_selected="true"
android:drawable="@drawable/detail_btn_frame_select" />
<item android:state_focused="true"
android:drawable="@drawable/detail_btn_frame_select" />
//Default
<item
android:drawable="@drawable/detail_btn_frame_norm" />
请做此帮助
推荐答案
试试这个,
android:state_focused="true"
在您选择的XML
这篇关于Android的列表项重点亘古不留onItemLongclickListener的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文