animGroup.removedOnCompletion =NO;
animGroup.fillMode =kCAFillModeForwards;
另备注一下常用的animationWithKeyPath
bounds
opacity
position
transform.rotation.z/y/x
transform.scale
今天看一个源码,发现还可以设置
borderColor
CABasicAnimation *borderAnimation = [CABasicAnimation animationWithKeyPath:@"borderColor"];
borderAnimation.fromValue = (id)[UIColor clearColor].CGColor;
borderAnimation.toValue = (id)stroke.CGColor;
borderAnimation.duration = 0.5f;
[view.layer addAnimation:borderAnimation forKey:nil]