首页 > 移动平台 > 详细

IOS解析动态GIF图的方法

时间:2015-08-15 21:37:37      阅读:266      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!