我有一个gif图像文件有4个图像,我喜欢在UIImage视图中逐一显示这些图像image.animation。请指导是否有可能显示或使用alternat告诉我。如何在UIImageView中使用gif图像iOS
谢谢。
我有一个gif图像文件有4个图像,我喜欢在UIImage视图中逐一显示这些图像image.animation。请指导是否有可能显示或使用alternat告诉我。如何在UIImageView中使用gif图像iOS
谢谢。
它会帮助你,支持GIF链接.. https://github.com/mayoff/uiimage-from-animated-gif更多帮助,请随时提出
感谢您的帮助链接,谢谢它解决我的问题。 – Youaregreat 2013-03-19 10:15:30
此链接不工作.. – iosLearner 2014-10-24 08:09:11
是的,它可能在iOS上,在这里,我封闭的一个URL。请到指这对你的概念,即使我做到了在这个链接的帮助下。
https://github.com/mayoff/uiimage-from-animated-gif
希望我抱你。
FLAnimatedImage是为iOS一个高性能的开源动画GIF发动机:
这是一个经过良好测试的组件,我写信给power all GIFs in Flipboard。
可悲的是,这个吊舱已经9个月没有维持。 – mxcl 2017-02-13 21:53:43
尝试像这样...所有的
- (void)viewDidLoad {
[super viewDidLoad];
NSURL *url = [[NSBundle mainBundle] URLForResource:@"loading" withExtension:@"gif"];
UIImage *loadingImage = [UIImage animatedImageWithAnimatedGIFData:[NSData dataWithContentsOfURL:url]];
self.dataImageView.animationImages = loadingImage.images;
self.dataImageView.animationDuration = loadingImage.duration;
self.dataImageView.animationRepeatCount = 1;
self.dataImageView.image = loadingImage.images.lastObject;
[self.dataImageView startAnimating];
}
首先,你可以添加在一个plist中的4张图片,然后执行以下代码。我希望它会工作
NSDictionary *picturesDictionary = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"PhotesArray" ofType:@"plist"]];
NSArray *imageNames = [picturesDictionary objectForKey:@"Photos"];
NSMutableArray *images = [[NSMutableArray alloc] init];
for (int i=0; i<[imageNames count]; i++) {
[images addObject:[UIImage imageNamed:[imageNames objectAtIndex:i]]];
}
//Normal animation
self.dataImageView.animationImages = images;
self.dataImageView.animationDuration = 3.0;
[self.dataImageView startAnimating];
欢迎...发布提问http://stackoverflow.com/questions/9744682/display-animated-gif-in-ios – 2013-03-19 09:26:30
谢谢之前,请做好搜索Lithu非常多你得到了我的问题点。 – Youaregreat 2013-03-19 09:42:32