滚动在PullToRefreshListView结束 [英] Scroll to end in a PullToRefreshListView

查看:140
本文介绍了滚动在PullToRefreshListView结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何编程在插入新项目到PullToRefreshListView滚动,这样的最后一个项目是可见的?

How do I programmatically upon inserting new items to a PullToRefreshListView scroll so that the last item is visible?

下面是一些code:

listView = (PullToRefreshListView) findViewById(R.id.list);
listView.setAdapter(someAdapter);

和我想这样做:

listView.scrollToEnd();

someAdapter.scrollToEnd();

或类似的东西。

推荐答案

您可以设置TranscriptMode上一个ListView有它总是滚动至底部时,被添加新的内容。

You can set the TranscriptMode on a ListView to have it always scroll to the bottom when new content is added

listView.setTranscriptMode(ListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);

您也可以使用

listView.scrollTo(0,listView.getHeight());

这篇关于滚动在PullToRefreshListView结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆