一、平移+旋转+缩放
#import "ViewController.h"
@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *imageV;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (IBAction)transform:(id)sender {
[UIView animateWithDuration:0.5 animations:^{
//1、平移
/**
CGAffineTransform带make与不带make区别?
1.带make相对的最原始的位置做形变操作.(一般只用做一次形变.)
2.不带make是相对于指定的形变开始进行.
相对于上一次操作(一般用于做多次形变.)
*/
// self.imageV.transform = CGAffineTransformMakeTranslation(0, 300);
// self.imageV.transform = CGAffineTransformTranslate(self.imageV.transform, 0, 50);
//2、旋转
//参数:旋转的角度(是弧度)
//self.imageV.transform = CGAffineTransformMakeRotation(M_PI);
// self.imageV.transform = CGAffineTransformRotate(self.imageV.transform, M_PI_2);
//3、缩放
//缩放比例(1代表是原始大小.)
//self.imageV.transform = CGAffineTransformMakeScale(1.5, 1.5);
//self.imageV.transform = CGAffineTransformScale(self.imageV.transform, 1.5, 1.5);
// self.imageV.transform = CGAffineTransformScale(self.imageV.transform, 0.8, 0.8);
}];
}