安卓:是否有可能刷新列表视图只是一个项目? [英] Android: Is it possible to refresh just one item in a listview?

查看:96
本文介绍了安卓:是否有可能刷新列表视图只是一个项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有可能重新呈现在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()

这篇关于安卓:是否有可能刷新列表视图只是一个项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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