动画GIF无法在iPhone上运行 [英] Animated GIF does not work on iPhone
本文介绍了动画GIF无法在iPhone上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 cell.image =一个动画gif文件
(单元格是 UITableViewCell
)。但是,它没有动画。有什么办法可以解决吗?
I am using cell.image = an animated gif file
(cell is UITableViewCell
). However, it does not animate. Is there any way I can fix it?
推荐答案
UIImageView
提供必要的API来制作你喜欢的动画:
UIImageView
provides the necessary APIs to produce your own animations like this:
UIImage *frame1 = [UIImage imageNamed:@"frame1.png"];
UIImage *frame2 = [UIImage imageNamed:@"frame2.png"];
UIImage *frame3 = [UIImage imageNamed:@"frame3.png"];
UIImage *frame4 = [UIImage imageNamed:@"frame4.png"];
UIImageView.animationImages = [[NSArray alloc] initWithObjects:frame1, frame2, frame3, frame4, nil];
UIImageView.animationDuration = 1.0 //defaults is number of animation images * 1/30th of a second
UIImageView.animationRepeatCount = 5; //default is 0, which repeats indefinitely
[UIImageView startAnimating];
//[uiImageView stopAnimating];
这篇关于动画GIF无法在iPhone上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文