我在 MKNetworkKit 中使用 UIImageView+MKNetworkKitAdditions 来显示来自网络的图像,但是当 UIImageView 在 tableView 单元中时,该方法
-(MKNetworkOperation*) setImageFromURL:(NSURL*) url
placeHolderImage:(UIImage*) image
animation:(BOOL) yesOrNo;
图像下载后不会立即显示图像。如果我使用
[tableView reloadData]
我不会看到显示图像的动画。所以我想知道如何解决这个问题。谢谢你。
我的代码在这里
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
if (!cell)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
[cell.imageView setImageFromURL:[NSURL URLWithString:@"https://www.google.com/images/srpr/logo11w.png"]];
return cell;
}