点击放大图片

CABasicAnimation *animation=[CABasicAnimation animationWithKeyPath:@"transform.scale"];

animation.toValue = @2.0f; //放大倍数

animation.duration = 0.5f;//动画时间

animation.autoreverses = NO;

//不还原初始状态

animation.removedOnCompletion = NO;

animation.fillMode = kCAFillModeForwards;

[self.button.layer addAnimation:animation forKey:@"scale"];

你可能感兴趣的:(点击放大图片)