CABasicAnimation *theAnimation;
theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.translation.y"];
theAnimation.duration=0.5;
theAnimation.repeatCount=0;
theAnimation.autoreverses=NO;
theAnimation.fromValue=[NSNumber numberWithFloat:100];
theAnimation.toValue=[NSNumber numberWithFloat:0];
//[self.quntityView animationDidStart:theAnimation];
[self.quntityView addAnimation:theAnimation forKey:@"animateLayer"];
答案 0 :(得分:0)
addAnimation:forKey:
是CALayer上的一种方法。你不能只是在UIView上调用它。
尝试:
[self.quntityView.layer addAnimation:theAnimation forKey:@"animateLayer"];