iOS 形变属性transform

 // transform:形变属性, 能完成的功能有平移、缩放、旋转
 
 [UIView animateWithDuration:0.5 animations:^{
 // 平移
 self.tempView.transform = CGAffineTransformMakeTranslation(0, 200);
 
 // 缩放
 self.tempView.transform = CGAffineTransformMakeScale(0.5, 0.5);
 
 // 旋转
 self.tempView.transform = CGAffineTransformMakeRotation(M_PI_4);
 
 // 三种效果叠加
 CGAffineTransform slation = CGAffineTransformMakeTranslation(0, 200);
 CGAffineTransform slationScale = CGAffineTransformScale(slation, 0.5, 0.5);
 CGAffineTransform slationScaleRotation = CGAffineTransformRotate(slationScale, M_PI_4);
 self.tempView.transform = slationScaleRotation;
 }];
 
 // 点击,累计形变属性
 self.tempView.transform = CGAffineTransformScale(self.tempView.transform, 0.8, 0.8);

你可能感兴趣的:(iOS 形变属性transform)