如何在我的项目中使用 SDWebImage [英] How to use SDWebImage in my project

查看:39
本文介绍了如何在我的项目中使用 SDWebImage的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 collectionview 加载图像.这些图像是从后台线程中的 url 加载的.因此滚动不流畅.url 中的图像在几秒钟后过期,因此我想用新图像更新图像.如何使用 SDWebImage 加载图像并使滚动平滑?任何人都可以帮我解决这个问题.

Iam using collectionview to load image.These images are loaded from url in background thread. Hence the scrolling is not smooth.The images in url get expired after seconds hence i want to update the image with new image.How can i use the SDWebImage to load image and make scrolling smooth? Can anyone please help me to solve this.

推荐答案

使用此代码

[YOUR_CELL_NAME.YOUR_IMAGE_NAME setImageWithURL:[NSURL URLWithString:@"IMAGE URL"] placeholderImage:[UIImage imageNamed:@"PLACEHOLDER IMAGE NAME"]];

这篇关于如何在我的项目中使用 SDWebImage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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