安卓:是否有可能刷新列表视图只是一个项目?有可能、只是一个、视图、项目

由网友(时光漫过心脏浮过脸庞)分享简介:我想知道是否有可能重新呈现在ListView只有一个元素?我想通过调用 notifyDatasetChanged()是要重新呈现整个名单? I'm wondering if it is possible to rerender just one element in a listview? I assume by c...

我想知道是否有可能重新呈现在ListView只有一个元素?我想通过调用 notifyDatasetChanged()是要重新呈现整个名单?

I'm wondering if it is possible to rerender just one element in a listview? I assume by calling notifyDatasetChanged() is gonna rerender the whole list?

谢谢

推荐答案

可以,但它是一个有点令人费解。你必须拿到第一个可见项的索引列表中,然后用该做决定的可视化项目的项目是需要更新的列表多么多么远了,然后抓住其观点和更新它。

You can, but it's a bit convoluted. You would have to get the index of the first visible item in the list and then use that do decide how how far down in the list of visual items the item is that needs updated, then grab its view and update it there.

这是很容易,只是叫 notifyDatasetChanged()

阅读全文

相关推荐

最新文章