ListView中滚动到所选项目 [英] ListView scroll to selected item
本文介绍了ListView中滚动到所选项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个编辑的文本和它下面的一个按钮,一个ListView。当我点击出现的键盘ListView项,推高了编辑文本和按钮。我想在列表滚动到所选择的项目。任何想法?谢谢
I have a ListView with an edit text and a button below it. When I click on a listView item the keyboard appears and push up the edit text and the button. I want the list to scroll to the selected item. Any idea? Thanks
推荐答案
您可以使用ListView的<一个href="http://developer.android.com/reference/android/widget/ListView.html#setSelection%28int%29"><$c$c>setSelection(int位置) 方法滚动到一排。
You can use ListView's setSelection(int position)
method to scroll to a row.
这篇关于ListView中滚动到所选项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文