How to show an activity indicator in SDWebImage

后端 未结 6 996
一向
一向 2020-12-25 12:50

Currently i am integrating SDWebImage in my project by following below things

1)#import \"UIButton+WebCache.h\"

2)[button setImageWithURL:url placeholderImag

6条回答
  •  醉话见心
    2020-12-25 13:40

    For swift 5

    //pass true for showing indicator View
    self.imageView.sd_setShowActivityIndicatorView(true)
    
    //give style value
    self.imageView.sd_setIndicatorStyle(UIActivityIndicatorView.Style.gray)
    
    //Set your image as you are want to do
    self.imageView.sd_setImage(with: URL(string: self.imageUrl), placeholderImage: UIImage())
    

提交回复
热议问题