UIViewController-UIView-CGAffineTransform-transform

#define runTime 1.0

#define kDetal 50

//左旋转

- (IBAction)runzuo:(id)sender {

    [UIViewbeginAnimations:nilcontext:nil];

    [UIViewsetAnimationDuration:1.0];

    _btn.transform = CGAffineTransformRotate(_btn.transform,- M_PI_4);

    [UIViewcommitAnimations];

}

//右旋转

- (IBAction)runright:(id)sender {

    [UIViewbeginAnimations:nilcontext:nil];

    [UIViewsetAnimationDuration:1.0];

    _btn.transform = CGAffineTransformRotate(_btn.transform, M_PI_4);

    [UIViewcommitAnimations];

}

//变大

- (IBAction)big:(id)sender {

    [UIViewbeginAnimations:nilcontext:nil];

    [UIViewsetAnimationDuration:1.0];

    _btn.transform = CGAffineTransformScale(_btn.transform, 1.2, 1.2);

    [UIViewcommitAnimations];

}

//变小

- (IBAction)minus:(id)sender {

    [UIViewbeginAnimations:nilcontext:nil];

    [UIViewsetAnimationDuration:1.0];

    _btn.transform = CGAffineTransformScale(_btn.transform, 0.8,0.8);

    [UIViewcommitAnimations];

}

你可能感兴趣的:(controller)