确保在Android的ListView可见? [英] ensure visible on android listview?
本文介绍了确保在Android的ListView可见?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法,我可以在Android的ListView makle确定某一项目的方式是完全可见?
Is there a way that I can makle sure a given item in an android listview is entirely visible?
我希望能够以编程方式滚动到一个特定的项目,就像当我preSS例如按钮。
I'd like to be able to programmatically scroll to a specific item, like when I press a button for example.
推荐答案
<一个href="http://developer.android.com/reference/android/widget/ListView.html#setSelection%28int%29"><$c$c>ListView.setSelection()$c$c>将滚动列表,以便所需的项目是在视口中。
ListView.setSelection()
will scroll the list so that the desired item is within the viewport.
这篇关于确保在Android的ListView可见?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文