如何在iPhone UIIMageView上显示GIF图像 [英] How to Display GIF Image on iPhone UIIMageView

查看:68
本文介绍了如何在iPhone UIIMageView上显示GIF图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找到了一些方法,但他们实际上是在阅读框架和应用转换,这会降低动画的质量..
有没有办法在iPHone应用程序上显示GIF,因为它是......?
先谢谢..

i have found some ways but they are actually reading frames and applying transition which reduces the quality of animation.. is there any way to display GIF on iPHone application as it is..? Thanks in Advance..

推荐答案

动画GIF不会动画,但如果你有GIF,请保存每个动画作为单独的GIF然后设置animationImages数组与您刚刚保存的所有GIF:

Animated GIF won't animate, but if you have a GIF, save each animation as a separate GIF and then setup animationImages array with all those GIFs you just saved:

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];

这篇关于如何在iPhone UIIMageView上显示GIF图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆