iOS SDWebImage fade in new image

后端 未结 8 1488
北海茫月
北海茫月 2021-01-31 06:36

I\'ve been using SDWebImage on my iPhone app to handle all of the image loading. I am using a placeholder image, and I want to crossfade or fade in the new image once it loads.

8条回答
  •  耶瑟儿~
    2021-01-31 07:06

    SDWebImage now offers a built-in fade transition as of 4.3.0.

    imageView.sd_imageTransition = SDWebImageTransition.fadeTransition;
    imageView.sd_setImage(with: ...)
    

    See the documentation here, you can perform more complex transitions using their API.

    https://github.com/rs/SDWebImage/wiki/Advanced-Usage#image-transition-430

提交回复
热议问题