Loading images from a URL into a UITableViewCell#39;s UIImageView(将图像从 URL 加载到 UITableViewCell 的 UIImageView)
问题描述
我有以下代码:(注意:newsImageURL
是一个 NSArray
)
I have the following code: (Note: newsImageURL
is an NSArray
)
我正在尝试使用以下代码将这些图像加载到单元格中:
I am trying to load these images into a cell using the code below:
当我改用这条线时,图像加载正常:
The image loads fine when I use this line instead:
我做错了什么?
推荐答案
您应该使用支持缓存、默认占位符和延迟加载图像的现有框架.
You should use an existing framework which supports caching, default place holders and lazy loading of images.
https://github.com/rs/SDWebImage 是一个不错的简单框架
https://github.com/rs/SDWebImage is a good and simple framework
这篇关于将图像从 URL 加载到 UITableViewCell 的 UIImageView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!