美文网首页
SDWebImage加载https图片失败

SDWebImage加载https图片失败

作者: 唐人街的乞丐 | 来源:发表于2022-07-13 18:22 被阅读0次

SDWebImage 加载https图片失败,去掉 “s”,加载https图片正常显示

/**
 * Set the imageView `image` with an `url`, placeholder and custom options.
 *
 * The download is asynchronous and cached.
 *
 * @param url         The url for the image.
 * @param placeholder The image to be set initially, until the image request finishes.
 * @param options     The options to use when downloading the image. @see SDWebImageOptions for the possible values.
 */
// 设置  options:SDWebImageAllowInvalidSSLCertificates
- (void)sd_setImageWithURL:(nullable NSURL *)url
          placeholderImage:(nullable UIImage *)placeholder
                   options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT;
// 使用方法
   [imageView sd_setImageWithURL:[NSURL URLWithString:cellModel.picUrl] placeholderImage:[UIImage imageNamed:@"placeholder"] options:SDWebImageAllowInvalidSSLCertificates];

相关文章

网友评论

      本文标题:SDWebImage加载https图片失败

      本文链接:https://www.haomeiwen.com/subject/sostirtx.html