我在 table 视图单元格中异步加载图像它工作得很好但是当我向下滚动时图像闪烁

I am loading image in table view cell asynchronously It's working perfectly fine but when i scroll down the image is flickering

我在 table 视图单元格中异步加载图像它工作得很好但是当我向下滚动时图像闪烁...

导入“UIImageView+WebCache.h”

[cell.imgProfilePic sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",[arrSearchedPic objectAtIndex:indexPath.row]]] placeholderImage:[UIImage imageNamed:@"placeholder.png"] completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { NSLog(@"下载完成..."); }];

使用此代码以及静态图像闪烁是否有任何我遗漏的内容请告诉我

任何帮助都将不胜感激。 谢谢

使用SDWebImage异步加载图片 使用这个 link

https://github.com/rs/SDWebImage

https://github.com/rs/SDWebImage 下载库 ..在文件夹中添加文件 将 SDWebImage 文件夹中的所有文件添加到您的项目中并导入此文件 #import "UIImageView+WebCache.h" 在索引路径方法中将此添加到您的 cellforRow [cell.imgProfileImage sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",[profileImage objectAtIndex:indexPath.row]]] placeholderImage:[UIImage imageNamed:@"unchecked.png" ] options:SDWebImageRefreshCached];

cell.imgprofileImage 将是您要在其中加载数据的图像视图..