连续自动滚动ListView

时间:2011-09-22 18:25:01

标签: android listview autoscroll

我在Android中有Listview。我希望Listview自己从上到下连续滚动。它应该无限发生

显然我想抓住Listview的任何项目的点击,发布滚动将继续

任何有此类实施经验的人。请帮忙!!

1 个答案:

答案 0 :(得分:5)

http://groups.google.com/group/android-developers/msg/753a317a8a0adf03

要自动滚动,您可以使用:listView.smoothScrollToPosition(position);

private void scrollMyListViewToBottom() {
    myListView.post(new Runnable() {
        @Override
        public void run() {
            // Select the last row so it will scroll into view...
            listView.smoothScrollToPosition(myListAdapter.getCount() - 1);
            // Just add something to scroll to the top ;-)
        }
    });
}