如何在单个animateWithDuration调用期间缩放和旋转

Chr*_*ris 9 iphone animation objective-c uikit ios

我正在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];   
                 }];
Run Code Online (Sandbox Code Playgroud)

msg*_*bel 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];   
                 }];
Run Code Online (Sandbox Code Playgroud)

希望有帮助!