###1.平移,缩放,旋转
//平移self.tempView.transform = CGAffineTransformMakeTranslation(-100, 100);//缩放self.tempView.transform = CGAffineTransformMakeScale(0.5, 0.5);//旋转self.tempView.transform = CGAffineTransformMakeRotation(-M_PI_4);
###2.除此之外还可以叠加动画效果,三种或者两种合起来
//平移+缩放+旋转CGAffineTransform translation = CGAffineTransformMakeTranslation(-100, 100);CGAffineTransform scaleTranslation = CGAffineTransformScale(translation, 0.5, 0.5);CGAffineTransform rotateScaleTranslation = CGAffineTransformRotate(scaleTranslation, M_PI_2); self.tempView.transform = rotateScaleTranslation;
###3.清空以前的效果,在回复原来的时候也可以做动画,跟之前相反的效果
// 清空transform,以前的平移、缩放、旋转都会消失[UIView animateWithDuration:2.0 animations:^{ self.tempView.transform = CGAffineTransformIdentity; }];