【问题标题】:Prevent ListView Scroll to top on notifyDAtaSetChanged防止 ListView 在 notifyDAtaSetChanged 上滚动到顶部
【发布时间】:2012-11-12 23:54:11
【问题描述】:

我使用的 listView 每隔几秒就会调用一次 notifyDataSetChanged(),如果用户向下滚动,他会自动滚动到顶部。

可能是什么原因? 我没有使用任何 .setSelection(0) 或其他强制滚动的方法。我可能做错了什么?

【问题讨论】:

  • 你有想过这个吗?
  • 不!我以为一定有一些 notifyDataSetChanged,但事实并非如此。
  • 答案就在这里:试试看vikinghammer.com/2011/06/17/…

标签: android


【解决方案1】:

使用 CursorAdapter 填充列表视图,问题消失了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-12
    • 2012-09-29
    • 2016-02-10
    • 2021-05-06
    • 2017-08-24
    相关资源
    最近更新 更多