我想要做一些图形元素消失,移动背景图像和新的将出现。问题是背景移动新动画出现在背景动画动画完成之前。 我在相关问题中没有看到很好的答案,所以我会很感激任何帮助。 伪代码:嵌套的UIVIew animateWithDuration不尊重完成
-(void)method1 {
[UIView animateWithDuration:0.6
delay:0.0 options:UIViewAnimationOptionCurveEaseIn
animations:^{
self.setThisOne.hidden = YES;
self.setThisAnother.hidden = YES;
}completion:^(BOOL finished) {
[UIView animateWithDuration:0.6
delay:0.3
options: UIViewAnimationOptionCurveEaseIn
animations:^{ self.background.frame = myFrame; //Move background image
} completion:^(BOOL finished){
if (finished) {
[self method2];
}
}
];
}];
}
-(void)method2 {
[UIView animateWithDuration:0.2
delay:0.3
options: UIViewAnimationOptionBeginFromCurrentState
animations:^{
self.aButtonsAppear.hidden = NO;
self.moreElementsApeear.hidden = NO
} completion:nil];
}
为什么使用UIViewAnimationOptionBeginFromCurrentState? – Moxy 2013-02-28 16:33:44
隐藏不具动画能力。第一个动画块被忽略。 – CodaFi 2013-02-28 16:38:18
我认为它允许以前的动画完成。无论如何,我有一个UIViewAnimationOptionCurveEaseInOut具有相同的效果。 – 2013-02-28 16:42:35