listView从底部回到顶部代码实现

可用如下方法:

1、平滑的回到顶部,但是会划过中间的每一页

mListView.getRefreshableView().smoothScrollToPosition(0);



2、直接跳到顶部

if (!mListView.getRefreshableView().isStackFromBottom()) {
mListView.getRefreshableView().setStackFromBottom(true);
}

 mListView.getRefreshableView().setStackFromBottom(false);

posted @ 2015-10-16 10:02  你好and程序员  阅读(171)  评论(0编辑  收藏  举报