HTML5   发布时间:2022-04-27  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了ios – 当图像网址没有改变但图像改变时,如何使用翠鸟设置图像大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
如果图像网址没有变化但图像更改,如Twitter或 GitHub,如何使用翠鸟检索正确的图像.

SDWebImage一个选项[SDWebImagerefreshCached]来解决问题.

/**
     * Even if the image is cached,respect the http response cache control,and refresh the image from remote LOCATIOn if needed.
     * The disk caching will be handled by NSURLCache instead of SDWebImage leading to slight perfoRMANce degradation.
     * This option Helps deal with images changing behind the same request URL,e.g. Facebook graph api profile pics.
     * If a cached image is refreshed,the completion block is called once with the cached image and again with the final image.
     *
     * Use this flag only if you can't make your URLs static with embedded cache busTing parameter.
     */
    SDWebImagerefreshCached = 1 << 4,

如何解决翠鸟的问题?

解决方法

Kingfisher有forcerefresh选项强制下载图像再次滑动缓存

imageView.kf.setImage(with: url,options: [.forcerefresh])

有关详细信息,请参阅此github线程

大佬总结

以上是大佬教程为你收集整理的ios – 当图像网址没有改变但图像改变时,如何使用翠鸟设置图像全部内容,希望文章能够帮你解决ios – 当图像网址没有改变但图像改变时,如何使用翠鸟设置图像所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。