CALayer动画缩放动画效果问题

来源:互联网 发布:mac 拷贝手机照片 编辑:程序博客网 时间:2024/06/06 20:58

   在用CABasicAnimation实现视图缩放效果的时候,如果不加上下面两句会入到视图缩放动画后又恢复原大小的问题

   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]


   

原创粉丝点击