2013-01-20 13 views
9

UIViewに次のコードを使用してアニメートしています。これは素晴らしいですが、同時にスケールをアニメートするにはどうすればいいですか?スピンしている間に0にスケールダウンするのが理想です。1回のanimateWithDurationコールでスケールと回転を行う方法

[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]; 
       }]; 

答えて

11

CGAffineTransformConcatメソッドを使用してください。試してみてください:

[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]; 
       }]; 

希望がある!

関連する問題