Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/121.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 滚动tableview获取重复图像_Ios_Uitableview_Scroll_Duplicates - Fatal编程技术网

Ios 滚动tableview获取重复图像

Ios 滚动tableview获取重复图像,ios,uitableview,scroll,duplicates,Ios,Uitableview,Scroll,Duplicates,Im使用NYXProgressiveImageView()将图像逐步加载到单元格中 当我滚动获取重复图像时 我怎样才能避免这种情况 -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { CustomCell *cell = (CustomCell*)[tableView dequeueReusableCellWithIdentifier:@

Im使用NYXProgressiveImageView()将图像逐步加载到单元格中

当我滚动获取重复图像时 我怎样才能避免这种情况

-(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,这还不够吗?