【发布时间】:2012-10-30 13:59:29
【问题描述】:
我需要停止 UIView 动画。我知道我可以使用[object.layer removeAllAnimations]; 但这不会停止动画,而是“跳过”它。所以,如果我的原始动画是:
[UIView animateWithDuration:8.0 delay:0.0 options:UIViewAnimationOptionAllowUserInteraction animations:^ (void) {
[ingredient setFrame:CGRectMake(20, 200, 34, 45)];
} completion:^ (BOOL finished) {
NSLog(@"Completed");
}];
对象成分将具有动画完成后的帧。相反,我希望对象在特定点停止,而动画不完整。
【问题讨论】:
-
如果您关闭设备,所有动画都会停止。
-
不是重复的,这个问题是关于“暂停”动画,而不是取消它。