我想做一些图形元素消失,移动背景图像,然后会出现新的图像元素.问题是当背景移动时,在背景移动动画完成之前出现新的背景.我没有在相关问题中看到一个好的答案,所以我会感激任何帮助.伪代码:
-(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];
}
}
];
}];
Run Code Online (Sandbox Code Playgroud)
}
-(void)method2 {
[UIView animateWithDuration:0.2
delay:0.3
options: UIViewAnimationOptionBeginFromCurrentState
animations:^{
self.aButtonsAppear.hidden = NO;
self.moreElementsApeear.hidden = NO
} completion:nil];
Run Code Online (Sandbox Code Playgroud)
}
| 归档时间: |
|
| 查看次数: |
1350 次 |
| 最近记录: |