美文网首页
Swift Kingfisher显示图片一个小问题

Swift Kingfisher显示图片一个小问题

作者: 玉思盈蝶 | 来源:发表于2020-09-16 18:15 被阅读0次

首先,不知道这是不是Kingfisher的一个小Bug,还是设计就是如此哈,

代码如下:

backgroundImageView.kf.setImage(with: URL(string: imageUrlStr),
                              placeholder: UIImage(named:"qianrenqianwei"),
                              options: [.keepCurrentImageWhileLoading])

当option是keepCurrentImageWhileLoading的时候,当图片加载url有问题,不显示默认图片,显示的上个正常显示的图片了?????我真是第一次见。。。。。。

改成下面就好了:

backgroundImageView.kf.setImage(with: URL(string: imageUrlStr),
                              placeholder: UIImage(named:"qianrenqianwei"),
                              options: [.cacheOriginalImage])

keepCurrentImageWhileLoading

当加载一个新图时,是否要保持当前的图片。

PS:有点迷,keepCurrentImageWhileLoading还是少用吧,哈哈哈

相关文章

网友评论

      本文标题:Swift Kingfisher显示图片一个小问题

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