版权声明:本文为博主原创文章,未经博主允许不得转载。
原文地址:http://blog.csdn.net/qq_31810357/article/details/50498380
- // 设定位置和大小
- CGRect frame = CGRectMake(50,340,[UIScreen mainScreen].bounds.size.width / 2,[UIScreen mainScreen].bounds.size.height / 2);
- frame.size = [UIImage imageNamed:@"640gif.gif"].size;
- // frame.size.width = [UIImage imageNamed:@"启动页640.gif"].size.width / 2;
- // frame.size.height = [UIImage imageNamed:@"启动页640.gif"].size.height / 2;
- // 读取gif图片数据
- NSData *gif = [NSData dataWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"640gif" 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];