2
我想安排一系列在整個屏幕上爲動畫介紹文字生成動畫的動畫。完成後的最後一個動畫應該啓動應該運行遊戲的遊戲刻度邏輯。UIView animateWithDuration不尊重延遲
由於某種原因,一切都馬上發生。任何人都可以闡明爲什麼會發生這種情況或更好的選擇?
[self.view bringSubviewToFront:_ViewIntroSeconds];
[UIView animateWithDuration:0.4 delay:0.0 options:UIViewAnimationOptionCurveEaseInOut
animations:^(void) {
[_IntroLabel1 setAlpha:1];
}
completion:^(BOOL finished){
}];
[UIView animateWithDuration:0.4 delay:3.0 options:UIViewAnimationOptionCurveEaseInOut
animations:^(void) {
[_IntroLabel2 setAlpha:1];
[_IntroLabel1 setAlpha:0];
[_IntroLabel1 setCenter:CGPointMake(0, _IntroLabel1.center.y)];
}
completion:^(BOOL finished){
}];
[UIView animateWithDuration:0.4 delay:5.0 options:UIViewAnimationOptionCurveEaseInOut
animations:^(void) {
[_IntroLabel3 setAlpha:1];
[_IntroLabel2 setAlpha:0];
[_IntroLabel2 setCenter:CGPointMake(0, _IntroLabel2.center.y)];
}
completion:^(BOOL finished){
[self updateGame];
[self updateClock];
[_ViewIntroSeconds setAlpha:0];
}];
不錯的想法,但我希望動畫持續時間和下一個動畫之間的延遲有所不同 – Chris
然後在相應的'animateWithDuration'塊中修改'delay'。請注意,「延遲」是累積的。如果將塊中的延遲設置爲1秒,2秒和3秒,則它們將在以下時間調用:1,3和6秒。 – n00bProgrammer
很好,謝謝! – Chris