像这样应用两个转换不会产生您期望的结果。你需要做的是将它们组合成一个单一的变换矩阵。以下应按预期工作。
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
// Create two separate transforms and concatenate them together.
// Use that new transform matrix to accomplish both transforms at once.
CGAffineTransform translate = CGAffineTransformMakeTranslation(0, 0);
CGAffineTransform scale = CGAffineTransformMakeScale(-1, 1);
resultsEnemy.transform = CGAffineTransformConcat(translate, scale);
[UIView commitAnimations];
编辑:基于关闭您澄清,你似乎想是这样的:
CGAffineTransform scale = CGAffineTransformMakeScale(-1, 1);
CGAffineTransform translate = CGAffineTransformMakeTranslation(0, 0);
[CATransaction begin];
[CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions];
resultsEnemy.transform = scale;
[CATransaction commit];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
resultsEnemy.transform = CGAffineTransformConcat(translate, scale);
[UIView commitAnimations];
如果你把前变换*动画块? – 2013-02-28 21:57:55
当您应用两个变形时,您只需创建一个(例如使用makeTranslation),然后您必须应用到当前CGAffineTransformRotate(resultsEnemy.transform,...),否则使用第二个变换完全覆盖第一个变形 – Ultrakorne 2013-02-28 21:59:47