화면 전체에 걸쳐 소개 텍스트를 애니메이션화하는 일련의 애니메이션을 예약하려고합니다. 완료시 가장 마지막 애니메이션은 게임을 실행해야하는 게임 진드기 논리를 시작해야합니다.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'블록에서 원하는 지연을 수정하십시오. '지연'은 누적 될 것입니다. 블록에서 지연 시간을 1, 2 및 3 초로 설정하면 1, 3 및 6 초에 지연이 호출됩니다. – n00bProgrammer
멋지게 완료되었습니다. 감사합니다. – Chris