本文介绍了SDWebImage在缓存之前处理图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从网上获取了很多图片,它们都是各种尺寸 - 它们可以是大,小等等。

I fetch a lot of images from the web, and they are all kind of sizes - they can be big, small etc..

所以我可以调整它们的大小当我在单元格中显示它们但这是低效的。在SDWebImage下载它们并调整其大小调整大小后,更好地调整它们的大小,而不是将大图像存储在磁盘上并为每个单元调整大小。

So I can resize them when I display them in the cell but this is inefficient. It's way better to resize them after SDWebImage have download them and cache them resized, instead of storing large images on disk and resize them for every cell.

所以我该怎么办这个用SDWebImage,或者我不得不攻击一下这个类?

So how can I do this with SDWebImage, or I have to hack a bit onto the class?

推荐答案

我和你有同样的问题,并尝试过首先调整SDWebImage,但最终构建了我自己的组件来解决问题。您可以在此处查看:

I had the same problem as you, and tried tweaking SDWebImage first, but ended up building my own component that solved the problem. You can take take a look at it here : https://github.com/adig/RemoteImageView

这篇关于SDWebImage在缓存之前处理图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 16:12