是否可以像UIImage一样获得CATransition动画?
问题描述:
是否有可能获得一个CATransition动画作为UIImage?我举个例子:是否可以像UIImage一样获得CATransition动画?
CATransition *animation = [CATransition animation];
[animation setDelegate:self];
[animation setDuration:0.35];
[animation setTimingFunction:UIViewAnimationCurveEaseInOut];
animation.type = @"pageCurl";
animation.fillMode = kCAFillModeForwards;
animation.endProgress = 0.65;
[animation setRemovedOnCompletion:NO];
[self.view.layer addAnimation:animation forKey:@"pageCurlAnimation"];
这就是我使用的动画。它看起来像这样: http://img269.imageshack.us/img269/8577/bildschirmfoto20100331u.png
我怎样才能捕捉到这个蜷缩效果?问题是我必须从self.view.layer中删除动画,但我稍后需要蜷缩的图片。是否有可能获得动画(帧)的图片? 我不想捕捉整个UIView,只有动画。
答
您可以在运行动画时使用UIGetScreenImage()。这会让你获得一个屏幕截图作为一个具有动画效果的图像。 信息在http://www.tuaw.com/2009/12/15/apple-relents-and-is-now-allowing-uigetscreenimage-for-app-st/