根据这个答案,有一种方法可以使 CGAffineTransform 永久化:
iphone - 使 CGAffineTransform 永久化
但它没有解释......答案讲述了动画生成的副本,但不清楚如何获取它并分配给原始对象,所以这是代码,如何使其永久化?
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.3];
[UIView setAnimationRepeatAutoreverses:NO];
[UIView setAnimationRepeatCount:1];
[UIView setAnimationDelegate:self];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
float angleRadians = 180 * ((float)M_PI / 180.0f);
CGAffineTransform t = CGAffineTransformMakeRotation(angleRadians);
self.myView.transform = t;
[self.myView setCenter:CGPointMake(160, 220)];
[UIView commitAnimations];
谢谢