1.清空transform,以前的平移宪潮、縮放溯警、旋轉(zhuǎn)都會消失
self.tempView.transform = CGAffineTransformIdentity;
2.CGAffineTransform***,能完成的功能:平移、縮放狡相、旋轉(zhuǎn)
self.tempView.transform = CGAffineTransformTranslate(self.tempView.transform, 100, 100);
self.tempView.transform = CGAffineTransformScale(self.tempView.transform, 0.8, 0.8);
self.tempView.transform = CGAffineTransformRotate(self.tempView.transform, M_PI_4);
3.CGAffineTransformMake***,能完成的功能:平移梯轻、縮放、旋轉(zhuǎn)
// 縮放
self.tempView.transform = CGAffineTransformMakeScale(0.5, 0.5);
// 平移
self.tempView.transform = CGAffineTransformMakeTranslation(-100, 100);
// 旋轉(zhuǎn)
self.tempView.transform = CGAffineTransformMakeRotation(-M_PI_4);
4.CGAffineTransformMake***的左右分離
CGAffineTransform translation = CGAffineTransformMakeTranslation(-100, 100);
CGAffineTransform scaleTranslation = CGAffineTransformScale(translation, 0.5, 0.5);
// CGAffineTransform rotateScaleTranslation = CGAffineTransformRotate(scaleTranslation, M_PI_2);
self.tempView.transform = scaleTranslation;