开发者

Why is my UITableView getting its images messed up?

开发者 https://www.devze.com 2022-12-24 12:57 出处:网络
I\'m trying to get my UITableView to show cells with images placed on them (contained in a UIImageView overlaid). I\'m wondering why when scrolling up and down, the im开发者_如何学Cages look like they

I'm trying to get my UITableView to show cells with images placed on them (contained in a UIImageView overlaid). I'm wondering why when scrolling up and down, the im开发者_如何学Cages look like they're overlaid on top of one another.

What can I do in this case for the sake of memory management as well as to fix this issue?

Why is my UITableView getting its images messed up?


Make sure that when you're dequeuing a reusable cell that you remove whatever image view was in the cell before you add the one for the current index path.

Alternatively, you can change the image property of the UIImageView.

0

精彩评论

暂无评论...
验证码 换一张
取 消