android listview滚动到listitems的数量

时间:2009-12-23 12:49:56

标签: android listview

我正在使用Listview,我希望在查看加载时向下滚动到列表的10项,怎么能这样做????

2 个答案:

答案 0 :(得分:11)

尝试yourListView.setSelection(position)

答案 1 :(得分:2)

试试这个:

mMessageList.addAll(result);
mMessageArrayAdapter.notifyDataSetChanged();

mMessageListView.clearFocus();
mMessageListView.post(new Runnable() {
    @Override
    public void run() {
        mMessageListView.setSelection(searchedMessagePosition);
    }
});