异步加载UITableViewCell中的图像 [英] loading image in UITableViewCell asynchronously
本文介绍了异步加载UITableViewCell中的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在UITableViewCell中异步加载图像的超级简单方法是什么?假设给定一个imageURL而不必继承UITableViewCell,即:标准UITableViewCell
What is the super very easy way to load the image in the UITableViewCell asynchronously say given a imageURL without having to subclassing the UITableViewCell, i.e: standard UITableViewCell
推荐答案
我知道最简单的方法是使用SDWebImage库。这是一个链接,解释如何利用SDWebImage库异步加载化身。
The easiest way I know is to use SDWebImage library. Here is a link that explains how to utilize the SDWebImage library to load avatars asynchronously.
SDWebImage是ImageView的扩展。以下是用法:
SDWebImage is an extension to the ImageView. Here is the usage:
// load the avatar using SDWebImage
[cell.imageView setImageWithURL:[NSURL URLWithString:tweet.profileImageUrl]
placeholderImage:[UIImage imageNamed:@"grad_001.png"]];
以下是引用的文章:
这篇关于异步加载UITableViewCell中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文