码迷,mamicode.com
首页 > 移动开发 > 详细

IOS解析动态GIF图的方法

时间:2015-08-15 21:39:11      阅读:291      评论:0      收藏:0      [点我收藏+]

标签:

  1. 利用SDWebimage第三方框架;

  2. 工程中导入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


IOS解析动态GIF图的方法

标签:

原文地址:http://my.oschina.net/wangbin618/blog/492984

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!