设置适配器后修改ListView

发布于 2024-11-16 20:09:56 字数 349 浏览 4 评论 0原文

我将适配器设置为ListView:

myListView.setAdapter(new listAdapter(this));

在这个适配器中,我做了一些操作,并在ListView的每一行中将图像设置为imageView:

holder.image.setImageDrawable(anImage)

我在项目中还有2个RadioButtons,我想做的是更改图像当我检查 RadioButton 时,出现一个 listView。

我的问题:我不知道如何“恢复”一条线的图像。有谁知道我该怎么做?

需要一些帮助,请。

I set an Adapter to a ListView:

myListView.setAdapter(new listAdapter(this));

in this adapter, I do some operations and I set an Image to the imageView in each lines of the ListView:

holder.image.setImageDrawable(anImage)

I also have 2 RadioButtons in the project, and what I want to do is changing the image of ONE listView when I check a RadioButton.

My problem: I don't know how "recover" an Image of a line. Does anyone know how I can do it?

Need some help, please.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清浅ˋ旧时光 2024-11-23 20:09:56

调用ListView.invalidateViews()。这将触发重绘并在 getView()bindView() 中设置正确的图像。

Call ListView.invalidateViews(). That'll trigger a redraw and set the correct image in getView() or bindView().

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文