我使用以下代码将动画分配给 uiimageview
Fire.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"firework1.png"],
[UIImage imageNamed:@"firework2.png"],
[UIImage imageNamed:@"firework3.png"],
[UIImage imageNamed:@"firework10.png"],nil];
[Fire setAnimationRepeatCount:0];
Fire.animationDuration = 0.5;
[Fire startAnimating];
我希望动画在达到 0.5 时停止我尝试了 if 语句,但它不起作用。请帮忙。
最佳答案
根据UIImageView将动画重复计数设置为 0 的文档将使其无限期重复,请尝试使用 [Fire setAnimationRepeatCount:1];
代替。
关于ios - 图片查看动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24989032/