【发布时间】:2009-01-14 08:58:04
【问题描述】:
我在一个 UIView 子类中(下面代码中的 CustomView)。
我正在 UIImageView 子类 (containerView) 中的图像周围绘制边框。核心图形代码位于子类的drawInRect: 中。
Core Animation 过渡是一个翻转,但是在绘制它时,不使用 Core Graphics 代码,即不调用 drawInRect: 来为 CALayer 提供我的渲染图像。
相反,我在没有任何核心图形绘制的情况下将动画从一个图像传递到另一个图像。
如何允许 CALayer 使用我的 Core Graphics 绘图而不是原始图像进行动画处理?
[CustomView beginAnimations:@"transitionNextImage" context:nil];
[CustomView setAnimationDuration:2.0];
[containerView setImage:image];
[CustomView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:containerView cache:YES];
[containerView setImage:differentImage];
[CustomView commitAnimations];
【问题讨论】:
标签: cocoa-touch core-animation core-graphics