简体   繁体   English

在UIWebview中加载gif图像 - iPhone

[英]Loading gif image in UIWebview - iPhone

When Iam loading a gif image in UIWebview in the iPhone 4.3 simulator it is getting an error like 当Iam在iPhone 4.3模拟器中的UIWebview中加载gif图像时,会出现类似的错误

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

And the gif image is not showing. 并且gif图像没有显示。 Can anyone help me... 谁能帮我...

Now in iPhone , Apple not supported .gif images. 现在在iPhone中 ,Apple不支持.gif图像。
You can use other type of images like png, jpg.. 你可以使用其他类型的图像,如png,jpg ..

If you have a serie of images you want to animate you can easily do it with UIImageView: 如果您有一系列想要制作动画的图像,可以使用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];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM