我有一个由标准 BaseAdapter 控制的 ListView。
当用户单击按钮时,我希望 ListView 滚动到查看第 100 条记录。
这是怎么做到的?
最佳答案
试试这个功能
public void setSelection (int position)
Since: API Level 1 Sets the currently selected item. If in touch mode, the item will not be selected but it will still be positioned appropriately. If the specified selection position is less than 0, then the item at position 0 will be selected. Parameters position Index (starting at 0) of the data item to be selected.
所以 myListView.setSelection(99);
关于Android ListView 跳转到光标位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3452878/