首先,不知道这是不是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
当加载一个新图时,是否要保持当前的图片。
网友评论