2013-01-20 15 views
9

Sto animando un UIView usando il seguente codice. Funziona alla grande ma come faccio ad animare la scala allo stesso tempo, preferirei che ridimensionasse a 0 mentre gira.Come ridimensionare e ruotare durante la singola animazione animata Chiamata di chiamata

[UIView animateWithDuration:0.4 delay:0.0 options:UIViewAnimationOptionCurveEaseInOut 
       animations:^(void) { 
        recognizer.view.transform = CGAffineTransformMakeRotation(DegreesToRadians(540)); 
        recognizer.view.backgroundColor = [[UIColor alloc] initWithRed:220.0/255.0 green:220.0/255.0 blue:220.0/255.0 alpha:1.0]; 
       }]; 

risposta

11

Basta usare il metodo CGAffineTransformConcat. Prova:

[UIView animateWithDuration:0.4 delay:0.0 options:UIViewAnimationOptionCurveEaseInOut 
       animations:^(void) { 
        recognizer.view.transform = CGAffineTransformConcat(CGAffineTransformMakeRotation(DegreesToRadians(540)), CGAffineTransformMakeScale(1.0, 1.0)); 
        recognizer.view.backgroundColor = [[UIColor alloc] initWithRed:220.0/255.0 green:220.0/255.0 blue:220.0/255.0 alpha:1.0]; 
       }]; 

La speranza che aiuta!

Problemi correlati