2011-08-23 29 views
0

我有一个imageview类的子类UIImageView类,它显示在一个UITableView dequeueReusableCellWithIdentifier。更新UIImageView中的UITableView单元格与透明度

@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]; 

任何想法?

回答

1

确保您没有使用UIImageView的新实例。它必须是您的代码正确工作的相同实例。你的想法听起来像它应该正常工作。