SDWebImage加载完毕动画

2016-03-15  本文已影响849人  三十一_iOS

今天看到的代码,动画效果不错,代码也比较简单,只有想不到,没有做不到。😁😁😁😁😁😁😁

动画效果.gif

代码也很简单:



    [self.iconImageView sd_setImageWithPreviousCachedImageWithURL:model.pictureUrl
                                                 placeholderImage:nil
                                                          options:0
                                                         progress:nil
                                                        completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
                                                            
                                                            if (cacheType == SDImageCacheTypeNone) {
                                                                
                                                                wself.iconImageView.image = image;
                                                                wself.iconImageView.alpha = 0;
                                                                wself.iconImageView.scale = 1.25f;
                                                                
                                                                [UIView animateWithDuration:0.35 animations:^{
                                                                    
                                                                    wself.iconImageView.alpha = 1.f;
                                                                    wself.iconImageView.scale = 1.f;
                                                                }];
                                                            }
                                                        }];
上一篇下一篇

猜你喜欢

热点阅读