当前位置: 代码迷 >> 综合 >> gif图显示
  详细解决方案

gif图显示

热度:72   发布时间:2024-01-21 19:39:28.0

读取gif图片数据

   NSData *data = [NSData dataWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"001" ofType:@"gif"]];    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0,0,200,200)];[webView loadData:data MIMEType:@"image/gif" textEncodingName:nil baseURL:nil];[self.view addSubview:webView];

但是使用UIWebView的弊端在于,不能设置Gif动画的播放时间。

  相关解决方案