设置适配器后修改ListView
我将适配器设置为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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
调用ListView.invalidateViews()。这将触发重绘并在
getView()
或bindView()
中设置正确的图像。Call
ListView.invalidateViews()
. That'll trigger a redraw and set the correct image ingetView()
orbindView()
.