2012-08-27 2 views
3

mise à l'échelle, j'ai l'animation suivante:ios CATransform3DMakeScale animation

CATransform3D scaleTransform = CATransform3DMakeScale(0.1,0.1, 1.0); 
scaleAnimation.toValue = [NSValue valueWithCATransform3D:scaleTransform]; 
keyframeAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];; 

où je suis mise à l'échelle vers le bas d'une sous-vue. Mais j'essaye de faire l'inverse. commencer à partir de 0,01% de la taille de la sous-vue et aller à 100% de la taille de la sous-vue. Est-ce que quelqu'un sait comment je peux faire ça?

Répondre

6

Faites ceci:

yourSubView.transform = CGAffineTransformMakeScale(0.01, 0.01); 
[UIView animateWithDuration:0.4 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ 
//change time duration according to requirement 
// animate it to the identity transform (100% scale) 
yourSubView.transform = CGAffineTransformIdentity; 
} completion:^(BOOL finished){ 
// if you want to do something once the animation finishes, put it here 
}]; 
+0

comment ajouter un peu de mouvement à l'animation comme CGPathMoveToPoint en utilisant le code ci-dessus? – Juan