开发者

Continuously Auto-Scrolling ListView

I have a Listview in Android. I want that the Listview continuously scrolls from top to bottom by itself. 开发者_开发技巧It should happen infinitely

And obviously I want to capture the click on any of the items of the Listview, post that the scroll will continue

Anybody having experience with such an implementation. Please help !!


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

To scroll automatically, you can use this: 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 ;-)
        }
    });
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜