我正在异步地在表视图单元格中加载图像它工作得很好但是当我向下滚动图像时闪烁...
import“UIImageView WebCache.h”
[cell.imgProfilePic sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@“%@”,[arrSearchedPic objectAtIndex:indexPath.row]]] placeholderImage:[UIImage imageNamed:@“placeholder.png”]已完成:^(UIImage * image ,NSError *错误,SDImageCacheType cacheType,NSURL * imageURL){NSLog(@“download completed ...”); }];
用户此代码以及静止图像闪烁是否有任何我想念的请告诉我
任何帮助都会很明显 . 谢谢
2 回答
使用SDWebImage异步加载图像使用此链接
https://github.com/rs/SDWebImage
https://github.com/rs/SDWebImage下载文件夹中的..add文件将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将是您要在其中加载数据的imageview .