【发布时间】:2011-08-23 16:44:05
【问题描述】:
我有一个图像视图类,它是 UIImageView 类的子类,它显示在一个 UITableView 中,该 UITableView 具有 dequeueReusableCellWithIdentifier。
@interface ImageView : UIImageView {
.
.
.
当需要将图像从一个图像更新到另一个图像时,更新本身会起作用
[self setImage:[UIImage imageWithContentsOfFile:[self resourcesDir:url]]];
但我的图像是透明的 PNG(具有相同的尺寸),因此部分可渗透图像在更新后的图像下可见(因为单元格本身被重复使用)
我尝试了各种方法让 imageView 先清除自己,但都没有奏效,这是我尝试过的:
self.image = nil;
[self setBackgroundColor:[UIColor clearColor]];
[self setNeedsDisplay];
[self performSelectorOnMainThread:@selector(setNeedsDisplay) withObject:nil waitUntilDone:NO];
有什么想法吗?
【问题讨论】:
标签: ios uitableview ios4 uiimageview transparent