0
카드가 3 장 있습니다. 처음에는 모든 카드가 오른쪽으로 이동 한 후 1 초 후 card2가보기의 왼쪽에 표시되고 다시 두 번째 카드 2가 오른쪽으로 이동합니다. 다음 코드를 사용하여 구현했습니다. 뷰로드 나는 다음과 같은 코드가있을 때, 여기 다른 애니메이션을 3 단계로 움직이면
counter = 0;
timer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(performAnimationToRight) userInfo:nil repeats:YES];
는 performAnimationToRightMethod
-(void)performAnimationToRight
{
if (counter == 0) {
CGAffineTransform transformToLeft = CGAffineTransformMakeTranslation(388,0);
[UIView beginAnimations:@"Move1" context:nil];
[UIView setAnimationDuration:2];
card0.transform = transformToLeft;
card1.transform = transformToLeft;
card2.transform = transformToLeft;
[UIView commitAnimations];
}else if(counter == 50){
card2.frame = CGRectMake(-300,card2.frame.origin.y, card2.frame.size.width, card2.frame.size.height);
}else if(counter == 200){
timer = nil;
counter = 0;
CGAffineTransform transformToLeft = CGAffineTransformMakeTranslation(-300,0);
[UIView beginAnimations:@"Move2" context:nil];
[UIView setAnimationDuration:2];
card2.transform = transformToLeft;
[UIView commitAnimations];
}
counter++;
}
문제의 구현 대신 왼쪽으로 오른쪽으로 이동 이동의 마지막 액션 카드 2에 그입니다 그리고 그것은,
CGAffineTransform transformToLeft = CGAffineTransformMakeTranslation(-300,0);
또는
어떠했는지의 여부를 제가 사용개