0
보기를 이동하는 데이 코드가 있습니다.CAAnimation : 애니메이션 후 재설정 안 함
CABasicAnimation *theAnimation;
theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.translation.x"];
theAnimation.duration=1;
theAnimation.repeatCount=1;
theAnimation.autoreverses=NO;
theAnimation.fromValue=[NSNumber numberWithFloat:0];
theAnimation.toValue=[NSNumber numberWithFloat:-60];
[view.layer addAnimation:theAnimation forKey:@"animateLayer"];
문제는 다음과 같습니다. 애니메이션의 완료 후에 뷰의 실제 좌표가 재설정됩니다. 애니메이션이 끝난 후 뷰가 새 좌표에 남아있을 수 있습니까?
감사합니다.
감사합니다. 다른 대답을 찾았습니다 : [theAnimation setFillMode : kCAFillModeForwards]; 그럼 잘 작동합니다. 링크를 가져 주셔서 감사합니다. – user688262