keyPath分为:transform.scale transform.scale.x transform.scale.y transform.scale.z
CABasicAnimation* scale = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
scale.fromValue = [NSNumber numberWithFloat:1];
scale.toValue = [NSNumber numberWithFloat:2];
scale.duration = 1;
scale.autoreverses = YES;
scale.repeatCount = 0;
view.layer addAnimation:scale forKey:@"scale"];
时间: 2024-11-03 22:43:52