2012-03-02 3 views
0
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

addAnimation:forKey: представляет собой метод на CALayer. Вы не можете просто называть его UIView.

Try:

[self.quntityView.layer addAnimation:theAnimation forKey:@"animateLayer"]; 
+0

[self.quntityView.layer addAnimation: theAnimation forKey: @ "animateLayer"]; Используя эту линию, представление анимируется правильно, и оно слишком медленное. Как можно ускорить просмотр во время его появления. –

+0

Я смущен тем, что вы имеете в виду. Вы просили длительностью в полсекунды, а анимация занимает больше половины секунды? –