__weak UIImageView *weekImage = imageView;
imageView.transform = CGAffineTransformMakeScale(0.1, 0.1);//x y方向的初始缩放比例;
[UIViewanimateWithDuration:.3animations:^{
weekImage.transform = CGAffineTransformMakeScale(1, 1);
} completion:^(BOOL finished) {
weekImage.transform = CGAffineTransformIdentity;//
}];
CGAffineTransformMakeTranslation : 每次都是以最初位置的中心点为参考
CGAffineTransformTranslate 每次都是以传入的transform为参照(既 有叠加效果)
CGAffineTransformIdentity 最初位置的中心点
// 不停的按 也只会动一次
- (IBAction)btn1Action:(id)sender {
self.imageView.transform=CGAffineTransformMakeTranslation(0,50);
}
// 不停的按 不停的动
- (IBAction)action2:(id)sender {
// self.imageView.transform = CGAffineTransformTranslate(CGAffineTransformIdentity, 0, 50);
self.imageView.transform =CGAffineTransformTranslate(self.imageView.transform, 0, 50);
}