在UITableView中延迟加载图像 [英] Lazy load images in UITableView

查看:122
本文介绍了在UITableView中延迟加载图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 UITableView 中有50个自定义单元格。我想在单元格中显示图像和标签,我从URL中获取图像。

I have some 50 custom cells in my UITableView. I want to display an image and a label in the cells where I get the images from URLs.

我想做一个懒的图像加载,这样UI就不会冻结正在加载图像时。我尝试在单独的线程中获取图像,但每次单元格再次可见时我必须加载每个图像(否则重复使用单元格会显示旧图像)。有人可以告诉我如何复制这种行为。

I want to do a lazy load of images so the UI does not freeze up while the images are being loaded. I tried getting the images in separate threads but I have to load each image every time a cell becomes visible again (Otherwise reuse of cells shows old images). Can someone please tell me how to duplicate this behavior.

推荐答案

结账
SDWebImage

README部分说明了如何在你的应用中使用它。

README Section says,how to use it in your app.

这篇关于在UITableView中延迟加载图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆