【问题标题】:Loading gif image in UIWebview - iPhone在 UIWebview 中加载 gif 图像 - iPhone
【发布时间】:2013-02-06 10:54:41
【问题描述】:

当我在 iPhone 4.3 模拟器的 UIWebview 中加载 gif 图像时,会出现类似

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

而且 gif 图像没有显示。谁能帮帮我...

【问题讨论】:

  • 用png代替gif,我感觉这个问题只出现在模拟器上。
  • 真的是gif图吗?你能在 iPhone 上用 Safari 打开 gif 吗?
  • @MichaelDautermann 是的,它是一个 gif 图像,我可以使用 safari 打开它
  • 您可以在 imageView 中制作多个图像的动画以显示 gif 图像功能..

标签: iphone ios uiwebview


【解决方案1】:

现在在 iPhone 中,Apple 不支持 .gif 图片。
您可以使用其他类型的图像,例如 png、jpg..

如果你有一系列的图片想要制作动画,你可以使用 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];

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-06
    • 2011-10-31
    • 2012-08-19
    • 1970-01-01
    • 2011-05-22
    相关资源
    最近更新 更多