J'essaie d'avoir un bouton déplacer à une des coordonnées, pause, passer à un autre co-orinates, pause, puis déplacer à nouveau. le processus devrait alors répéter indéfiniment. ce que j'ai en ce moment déplace juste la dernière étape.l'animation d'un bouton avec des retards - iPhone
c'est ce que j'ai jusqu'à présent (« moteur » est le nom UIButton):
- (void) firstAnimation {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
[UIView setAnimationDelay:5];
[UIView setAnimationRepeatCount:-1];
[UIView setAnimationRepeatAutoreverses:NO];
CGPoint pos = mover.center;
pos.y = 200.f;
pos.x = 169.f;
mover.center = pos;
[NSTimer timerWithTimeInterval:1.0 target:self selector:@selector(firstAnimation:) userInfo:nil repeats:NO];
pos.y = 100.f;
pos.x = 179.f;
mover.center = pos;
[NSTimer timerWithTimeInterval:1.0 target:self selector:@selector(firstAnimation:) userInfo:nil repeats:NO];
pos.y = 160.f;
pos.x = 129.f;
mover.center = pos;
[UIView commitAnimations];
}
Merci pour toute aide
merci pour votre message. J'utilise ce qui suit pour fondre et masquer une image. comment le ferais-je répéter indéfiniment? - (void) {firstAnimation \t \t [UIView animateWithDuration: 2,0 \t \t \t \t \t \t \t \t \t \t animations:^{ \t \t \t \t \t \t \t \t \t \t \t \t tapImage.alpha = 0,0 ; \t \t \t \t \t \t \t \t \t \t \t \t tapImage.alpha = 1,0; \t \t \t \t \t \t \t \t \t \t \t} \t \t achèvement:^(BOOL terminé) { \t \t \t \t \t \t \t \t \t \t \t \t [self secondAnimation]; }]; } – hanumanDev