J'utilise le code suivant pour déplacer une étiquette d'une position à une autre dans la direction xComment déplacer une vue ou une étiquette dans le sens X en utilisant CABasicAnimation dans iPhone
CABasicAnimation *theAnimation;
theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.translation.x"];
theAnimation.duration=1;
theAnimation.repeatCount=1;
theAnimation.autoreverses=NO;
theAnimation.fromValue=[NSNumber numberWithFloat:0];
theAnimation.toValue=[NSNumber numberWithFloat:80];
[lbl.layer addAnimation:theAnimation forKey:@"animateLayer"];
Mais dans ce cas, à la fin de l'animation l'étiquette revient à sa position d'origine. Comment s'assurer qu'il reste à la position où il est déplacé.
Y at-il un bon moyen de le faire sans utiliser le minuteur et en changeant les coordonnées par nous-mêmes.
étonnante, il fonctionne très bien. – rkb