标签:
利用SDWebimage第三方框架;
工程中导入UIImage+GIF.h
#import "UIImage+GIF.h"
@interface ViewController ()
@property (nonatomic,strong) UIImageView *loadimageView;
@end
#define URLQ @"http://img4.duitang.com/uploads/item/201411/12/20141112224456_xyc4P.thumb.700_0.gif"
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
NSURL *url = [NSURL URLWithString:URLQ];
NSData *imageData = [NSData dataWithContentsOfURL:url];
_loadimageView = [[UIImageView alloc]initWithFrame:CGRectMake(50, 100, 250, 250)];
_loadimageView.image = [UIImage sd_animatedGIFWithData:imageData];
[self.view addSubview:_loadimageView];
}
@end
标签:
原文地址:http://my.oschina.net/wangbin618/blog/492984