GIf显示

来源:互联网 发布:linux shell 打印日志 编辑:程序博客网 时间:2024/05/29 10:56

GIf显示

第三方类 SCGIFImageView

[GitHub]https://github.com/tianNanYiHao/SCGifExample.git

使用方法

NSString *path = [[NSBundle mainBundle]pathForResource:@"1.gif" ofType:nil];    NSData   *data = [NSData dataWithContentsOfFile:path];    SCGIFImageView *imageGIFView = [[SCGIFImageView alloc] initWithFrame:CGRectMake(0, 200, self.view.bounds.size.width, self.view.bounds.size.width)];    [imageGIFView setData:data];    [self.view addSubview:imageGIFView];

注意:
**由于是用非arc环境写的,所以还需要在工程的targets**Build Phases - > Compile Sources 下 对应的需要修改的(SCGIFImageView) 下 修改编译环境
-fno-objc-arc
即可

这里写图片描述

0 0
原创粉丝点击