我在用着
UIView animateKeyframesWithDuration
我有 3 个动画部分使用
[UIView addKeyframeWithRelativeStartTime
但是,在我想缓和的关键帧之一上。
如何为此添加缓动功能?
我在用着
UIView animateKeyframesWithDuration
我有 3 个动画部分使用
[UIView addKeyframeWithRelativeStartTime
但是,在我想缓和的关键帧之一上。
如何为此添加缓动功能?
这是一篇值得信赖的文章:httpsCAAnimation
://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/Animation_Types_Timing/Articles/Timing.html 您将不得不
处理UIView
.
更新:由于 PO 到目前为止还没有做到,因此有一些关于可能出错的问题: a) 确保您的动画是按如下方式创建和添加的:
CABasicAnimation* fadeAnim = [CABasicAnimation animationWithKeyPath:@"opacity"];
fadeAnim.fromValue = [NSNumber numberWithFloat:1.0];
fadeAnim.toValue = [NSNumber numberWithFloat:0.0];
fadeAnim.duration = 1.0;
[theLayer addAnimation:fadeAnim forKey:@"opacity"];
// Change the actual data value in the layer to the final value.
theLayer.opacity = 0.0;
b) 使用时 animateTransition:
,请确保:
所有动画都必须发生在由 transitionContext 的 containerView 属性指定的视图中。
(访问https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewControllerAnimatedTransitioning_Protocol/#//apple_ref/occ/intfm/UIViewControllerAnimatedTransitioning/animateTransition:供参考)。希望这将帮助您解决所有问题。