Ios 滚动tableview获取重复图像
Im使用NYXProgressiveImageView()将图像逐步加载到单元格中 当我滚动获取重复图像时 我怎样才能避免这种情况Ios 滚动tableview获取重复图像,ios,uitableview,scroll,duplicates,Ios,Uitableview,Scroll,Duplicates,Im使用NYXProgressiveImageView()将图像逐步加载到单元格中 当我滚动获取重复图像时 我怎样才能避免这种情况 -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { CustomCell *cell = (CustomCell*)[tableView dequeueReusableCellWithIdentifier:@
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
CustomCell *cell = (CustomCell*)[tableView dequeueReusableCellWithIdentifier:@"Customcell"];
if (cell == nil) {
// Load the top-level objects from the custom cell XIB.
NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];
// Grab a pointer to the first object (presumably the custom cell, as that's all the XIB should contain).
cell = [topLevelObjects objectAtIndex:0];
}
[cell.Imageview1 loadImageAtURL:[NSURL URLWithString:MyURL]];//Here Imageview1 is NYXProgressiveImageView.
}
我认为这是由于渐进式下载,我想做类似的事情
如何使用NYXProgressiveImageView类执行此操作
谢谢。您需要子类化
UITableViewCell
覆盖prepareforeuse
并设置imageView.image=nil
。单元格在表中被重用,因此除非在重用之前将其清除,否则它将显示为“复制”您的数据。您需要将UITableViewCell
重写prepareForReuse
并设置imageView.image=nil
。单元格在表格中重复使用,因此除非在重复使用之前将其清除,否则它将显示为“复制”您的数据。您可以尝试一下,它支持渐进式图像解码,并且没有已知的错误。查看演示项目,了解如何启用和使用渐进式解码的示例。您可以尝试一下,它支持渐进式图像解码,并且没有已知的错误。查看演示项目,了解如何启用和使用渐进解码的示例。Im在“didEndDisplayingCell”方法中设置nil,这还不够吗?Im在“didEndDisplayingCell”方法中设置nil,这还不够吗?