读取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动画的播放时间。