【发布时间】:2016-03-11 06:59:14
【问题描述】:
大家好,我是 IOS 开发的新手,我有一个 UICollection,我在其中使用 SDWebImageCache 加载图像。问题是我的 UICollectionview 单元在快速滚动时感觉像抽搐或颤抖。 下面我发布了使用 SDWebImageCache 加载图像的代码
[_homeCellImage sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",[dictionary objectForKey:@"user_image"],[QPCommonClass cropImageWithWidth:500 andHeight:500]]] placeholderImage:[UIImage imageNamed:@"defaultIcon"]];
[_qpQuestionImage sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",[dictionary objectForKey:@"image"],[QPCommonClass cropImageWithWidth:1400 andHeight:1200]]] placeholderImage:[UIImage imageNamed:@"question"] options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL){
[_qpHomeActivityIndicator setHidden:YES];
[_qpHomeActivityIndicator stopAnimating];
}];
其中 _homeCellImage 和 _qpQuestionImage 是 UIImageViews
【问题讨论】:
-
注释掉以上行是否消除了抽搐?
标签: ios objective-c iphone uicollectionviewcell sdwebimage