【问题标题】:I am loading image in table view cell asynchronously It's working perfectly fine but when i scroll down the image is flickering我正在异步加载表格视图单元格中的图像它工作得很好但是当我向下滚动时图像闪烁
【发布时间】:2015-07-07 07:13:12
【问题描述】:

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

导入“UIImageView+WebCache.h”

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

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

任何帮助都将是可观的。 谢谢

【问题讨论】:

标签: ios tableview cell


【解决方案1】:

使用 SDWebImage 异步加载图片 使用此链接

https://github.com/rs/SDWebImage

【讨论】:

    【解决方案2】:

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

    cell.imgprofileImage 将是您要在其中加载数据的 imageview..

    【讨论】:

      猜你喜欢
      • 2011-12-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多