iPhone 4.3 シミュレーターの UIWebview で gif 画像をロードすると、次のようなエラーが発生します。
ImageIO: <ERROR> _CGImagePluginInitGIFmalformed GIF frame#0 (640 x 960)
そして、gif画像は表示されていません。誰か助けてくれませんか...
現在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];