我可以更新detailTextLabel.text,并且UITableViewCell显示运行时的更改,但是如果我尝试更新imageView.image,它不会更改可见图像。任何想法为什么?我曾尝试在UITableViewCell上专门调用刷新,但无济于事。UITableViewCell图像未更新
-(void)getImageForURL:(NSURL*)url row:(UITableViewCell*)cell {
UIImage*image;
image = [UIImage imageWithData:[NSData dataWithContentsOfURL:url];
cell.imageView.image = image; // Does not work..
cell.detailTextLabel.text = @"test"; // Works
}
是的。我在最初放置一个占位符图形,然后调用这个函数来替换BG中的占位符。 – 2010-12-10 18:41:22
您是否偶然将图像重置为数据源回调中的占位符?也许,下载的图像不是你所期望的?然后检查它的大小和CGImage属性。只需要踢,也可以在赋值之前和之后检查cell.imageView.image的值。 – Costique 2010-12-10 19:00:38