1
UIImageView를 화면의 한면에서 회전 한 다음 다른면으로 되돌릴 수있는 방법은 무엇입니까? 바퀴를 회전시키고 변환한다고 가정 해 보겠습니다. 중간에서 다음 화면에서 왼쪽으로, 그 다음에 "돌아 오는"오른쪽에서 다시 중간 ..UIImageView를 회전하여 화면에 표시합니다.
나는 다음과 같은 코드를 사용하여 화면에서 회전하고 번역합니다.
CABasicAnimation* rotationAnimation;
rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
rotationAnimation.toValue = [NSNumber numberWithFloat: -M_PI * 2.0 /* full rotation*/ * 2 * 1 ];
rotationAnimation.duration = 1;
rotationAnimation.cumulative = YES;
rotationAnimation.repeatCount = 1.0;
rotationAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
rotationAnimation.delegate = self;
CABasicAnimation* translationAnimation;
translationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"];
translationAnimation.toValue = [NSNumber numberWithFloat:-700];
translationAnimation.duration = 1;
translationAnimation.cumulative = YES;
translationAnimation.repeatCount = 1.0;
translationAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
translationAnimation.removedOnCompletion = NO;
translationAnimation.fillMode = kCAFillModeForwards;
만약 이것이 올바른 길이라면 제발 도와주세요!