【问题标题】:how to prevent position goes top after adding items into listview, and notifyDataSetChanged将项目添加到listview和notifyDataSetChanged后如何防止位置上升
【发布时间】:2011-07-03 11:06:43
【问题描述】:
    messages.addAll(0,lstLoadedTop10);

    adapter.notifyDataSetChanged();

问题是。

在我将项目添加到列表视图并执行 notifyDataSetChanged();

滚动条到顶部。

但我想连续观看屏幕上的项目。

例如。在推特应用中,加载更多推特后位置不会上升。

对不起,我的英语很差。提前致谢。

【问题讨论】:

  • 你有想过这个吗?

标签: android listview


【解决方案1】:

如果你使用ScrollView,那就很简单了。

试试这个:scrollTo(int x, int y)。阅读更多here

祝你好运

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多