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

来源:互联网 发布:个人免签自动发卡源码 编辑:程序博客网 时间:2024/05/01 11:41

可用如下方法:

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

mListView.getRefreshableView().smoothScrollToPosition(0);



2、直接跳到顶部

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

 mListView.getRefreshableView().setStackFromBottom(false);

0 0
原创粉丝点击