类似SO质疑裁判:Why does UIView:animateWithDuration complete immediately?然而,我的代码使用[UIView的beginAnimation]等ipad:为什么我的顺序动画的第一个动画总是立即完成?
我基本上这样的:
[UIView beginAnimation ...];
[UIView setAnimationDelay: 0.0];
[UIView setAnimationDuration: 1.25];
animatedImage.transform = "scale-up transform";
[UIView setAnimationDelay: 1.25]
[UIView setAnimationDuration: 0.50];
animatedImage.transform = "scale-down transform";
[UIView commitAnimation];
的图像立即跳转到扩大规模的大小,然后1.25秒后,它很好地适应“缩小”尺寸。如果我链接更多的序列,它们都可以正常工作,除了第一个。
这是否与嵌套的beginAnimations功能相同?因为我尝试过并且发生同样的失败。同时,我会尝试您的建议并回复给您(感谢您的快速回复)。 – mobibob
如果您使用两个独立的beginAnimations,则第二个将停止第一个。在第二个延迟可能工作,从来没有测试过,但我认为使用beginAnimationsWithDuration更好,因为你可以设置持续时间。完成也比延迟处理更稳定,另外还有另外一个版本的beginAnimations,它提供了更多参数,可以让您在动画中设置特殊选项。 – Aberrant
对不起,我不是这个意思。该文件说,你可以嵌套[UIView beginAnimation] [UIView beginAnimation [UIView commitAnimation] [UIView commitAnimation]。这相当于你的代码吗? – mobibob