Ios 从UIViewAnimation获取UIImages

Ios 从UIViewAnimation获取UIImages,ios,Ios,我有一些简单的动画代码: [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:duration]; [UIView setAnimationCurve:curve]; [UIView setAnimationBeginsFromCurrentState:YES]; // The transform matrix CGAffineTransform transform = CGAffineTransfor

我有一些简单的动画代码:

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:duration];
[UIView setAnimationCurve:curve];
[UIView setAnimationBeginsFromCurrentState:YES];

// The transform matrix
CGAffineTransform transform = CGAffineTransformMakeTranslation(x, y);
image.transform = transform;

// Commit the changes
[UIView commitAnimations];

可以将动画的每个帧作为uiimages获取吗?

您无法将每个帧作为uiimages获取(除非您在动画视图的帧上以非常快的速度使用
UIGraphicsGetCurrentContext
,我甚至不确定这是否可行),但是对于核心动画,您可以访问CALayer的
presentationLayer
属性,该属性(从中):

返回包含当前事务开始时的所有特性的图层副本,并应用任何活动动画

希望这有帮助