在 Iphone UIImageView 中添加动画 Gif 图像 [英] Add animated Gif image in Iphone UIImageView
本文介绍了在 Iphone UIImageView 中添加动画 Gif 图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要从 UIImageview 中的 URL 加载动画 Gif 图像.
I need to load an animated Gif image from a URL in UIImageview.
当我使用普通代码时,图像没有加载.
When I used the normal code, the image didn't load.
有没有其他方法可以加载动画 Gif 图像?
Is there any other way to load animated Gif images?
推荐答案
UIImageView* animatedImageView = [[UIImageView alloc] initWithFrame:self.view.bounds];
animatedImageView.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"image1.gif"],
[UIImage imageNamed:@"image2.gif"],
[UIImage imageNamed:@"image3.gif"],
[UIImage imageNamed:@"image4.gif"], nil];
animatedImageView.animationDuration = 1.0f;
animatedImageView.animationRepeatCount = 0;
[animatedImageView startAnimating];
[self.view addSubview: animatedImageView];
您可以加载多个 gif 图像.
You can load more than one gif images.
您可以使用以下 ImageMagick 命令分割您的 gif:
You can split your gif using the following ImageMagick command:
convert +adjoin loading.gif out%d.gif
这篇关于在 Iphone UIImageView 中添加动画 Gif 图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文