9

UIView次のコードを使用してアニメーションを作成しています。これはうまく機能しますが、同時にスケールをアニメーション化するにはどうすればよいですか。理想的には、回転しながら0にスケールダウンしたいと思います。

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

1 に答える 1

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

それが役立つことを願っています!

于 2013-01-20T23:30:38.717 に答える