UIImageView *loadingImagView = [[UIImageView alloc]init];
loadingImagView.frame = CGRectMake(SCREEN_WIDTH/2 - SCREEN_WIDTH/8, SCREEN_HEIGHT/2 - SCREEN_HEIGHT/4, SCREEN_WIDTH/4, SCREEN_WIDTH/4);
NSString *path = [[NSBundle mainBundle] pathForResource:@"缓冲图" ofType:@"gif"];
NSData *data = [NSData dataWithContentsOfFile:path];
UIImage *image = [UIImage sd_animatedGIFWithData:data];
loadingImagView.image = image;
[self addSubview:loadingImagView];
利用SDWebImage中的UIImage+GIF
调用sd_animatedGIFWithData实现加载GIF
网友评论