Iphone CATTransition动画关键点始终“始终”;“过渡”;
有一个基本的分类。工作Iphone CATTransition动画关键点始终“始终”;“过渡”;,iphone,ios,core-animation,calayer,quartz-graphics,Iphone,Ios,Core Animation,Calayer,Quartz Graphics,有一个基本的分类。工作 animationKey = @"fadeIn"; [self.icon setImage:self.iconSelected]; [self.shadow setAlpha:1.0]; CATransition *transitionIn = [CATransition animation]; transitionIn.removedOnCompletion = NO; t
animationKey = @"fadeIn";
[self.icon setImage:self.iconSelected];
[self.shadow setAlpha:1.0];
CATransition *transitionIn = [CATransition animation];
transitionIn.removedOnCompletion = NO;
transitionIn.delegate = self;
transitionIn.duration = 1.2;
transitionIn.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transitionIn.type = kCATransitionFade;
[self.icon.layer addAnimation:transitionIn forKey:animationKey];
[self.shadow.layer addAnimation:transitionIn forKey:animationKey];
[CATransaction commit];
这是关键:
[self.icon.layer animationForKey:animationKey]
始终返回NULL
当我这样做时:
[self.icon.layer animationKeys]
我得到:
icon keys: (
transition
)
这里我遗漏了什么?说“特殊键KCATRANSION自动用于过渡动画。”