【问题标题】:Listview/ExpandableListView image content flick when call notifyDataSetChanged调用 notifyDataSetChanged 时 Listview/ExpandableListView 图像内容闪烁
【发布时间】:2011-07-04 01:16:47
【问题描述】:

Listview/ExpandableListView 会不断更新,会有新的进出。并且每一行都包含图像视图和文本。

当我调用notifyDataSetChanged 时,随机行的图像视图会闪烁。 我知道视图的原因是从上到下刷新。但是有什么方法可以在不刷新整个列表的情况下更新内容,或者无论如何使图像视图不闪烁?

我也试过Invalidate(),但这不是我想要的。

有没有办法自定义listview/ExpandableListView来使用?

【问题讨论】:

    标签: android listview expandablelistview


    【解决方案1】:

    一件事可以做,

    1.获取当前屏幕上的所有子视图这可能会对您有所帮助-https://stackoverflow.com/questions/2001760/android-listview-get-data-index-of-visible-item/2002413#2002413

    2.then 在每个孩子中先更新数组,然后查看需要更新的视图,而不是图像 How can I update a single row in a ListView?

    希望对你有帮助。

    谢谢。

    【讨论】:

      猜你喜欢
      • 2014-08-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-24
      • 2015-07-30
      • 1970-01-01
      相关资源
      最近更新 更多