显示 GIF 图片
2015-09-08 17:52
246 查看
// 用 uiwebimage
来显示 gif 图片
//
设定位置和大小
CGRect frame = CGRectMake(50,500,0,0);
frame.size = [UIImage
imageNamed:@"1440470244396823.gif"].size;
//
读取gif图片数据
NSData *gif = [NSData
dataWithContentsOfFile: [[NSBundle
mainBundle] pathForResource:@"1440470244396823"
ofType:@"gif"]];
// view生成
UIWebView *webView = [[UIWebView
alloc] initWithFrame:frame];
webView.userInteractionEnabled =
NO;//用户不可交互
[webView loadData:gif
MIMEType:@"image/gif"
textEncodingName:nil
baseURL:nil];
[self.view
addSubview:webView];
[webView
release];
来显示 gif 图片
//
设定位置和大小
CGRect frame = CGRectMake(50,500,0,0);
frame.size = [UIImage
imageNamed:@"1440470244396823.gif"].size;
//
读取gif图片数据
NSData *gif = [NSData
dataWithContentsOfFile: [[NSBundle
mainBundle] pathForResource:@"1440470244396823"
ofType:@"gif"]];
// view生成
UIWebView *webView = [[UIWebView
alloc] initWithFrame:frame];
webView.userInteractionEnabled =
NO;//用户不可交互
[webView loadData:gif
MIMEType:@"image/gif"
textEncodingName:nil
baseURL:nil];
[self.view
addSubview:webView];
[webView
release];
相关文章推荐
- js前台加密传输到后台C#解密
- 文件操作 输入
- SQL中关键字的执行顺序
- sql语句
- HDU2037
- Unity3D中用于工具制作常用属性(Attribute)
- Android 性能优化的一些建议
- android高手进阶教程(一)之--android中的消息机制
- 解析java实体类
- 为 Java 程序员准备的 Go 入门 PPT
- java素数
- 说说EMC解决方案中的那些产品和案例(一)
- Android OkHttp完全解析
- IOS第一天多线程-01pthread
- ThinkPHP函数详解:M方法
- [LeetCode] Valid Sudoku
- 客户端发送xml数据,服务器端接收之
- hive技术简介
- 从零开始编写图片加载库(三)之线程池图片下载
- Android: Looper, Handler, HandlerThread. Part II