繁体   English   中英

当图像网址没有改变但图像改变时,如何使用翠鸟设置图像

[英]How to set image using Kingfisher when image url did not change but image changed

如果图像网址没有变化但图像更改,如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线程以获取更多详细信息

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM