Loading gif image in UIWebview - iPhone

廉价感情. 提交于 2019-12-24 09:58:29

问题


When Iam loading a gif image in UIWebview in the iPhone 4.3 simulator it is getting an error like

ImageIO: <ERROR> _CGImagePluginInitGIFmalformed GIF frame#0 (640 x 960)

And the gif image is not showing. Can anyone help me...


回答1:


Now in iPhone, Apple not supported .gif images.
You can use other type of images like png, jpg..

If you have a serie of images you want to animate you can easily do it with UIImageView:

UIImage *image1 = [UIImage imageNamed:@"image1.png"];
UIImage *image2 = [UIImage imageNamed:@"image2.png"];
UIImage *image3 = [UIImage imageNamed:@"image3.png"];

self.imageView.animationImages = [[NSArray alloc] initWithObjects:image1,image2,image3, nil];
self.imageView.animationRepeatCount = 7;
[self.imageView startAnimating];


来源:https://stackoverflow.com/questions/14727281/loading-gif-image-in-uiwebview-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!