CABasicAnimation动画及其keypath值和作用

//tarnsform放大缩小动画

CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];//根据传的keypath实现不同动画

animation.duration = 0.3f;

animation.repeatCount = 0;

animation.autoreverses = YES;

animation.fromValue = [NSNumber numberWithFloat:1.0f];

animation.toValue = [NSNumber numberWithFloat:1.1f];

animation.byValue = [NSNumber numberWithFloat:0.9f];

animation.removedOnCompletion = YES;

[view.layer addAnimation:animation forKey:@"animation_key"];
keypath值:

transform.scale = 大小比例

transform.scale.x = 宽的比例转换

transform.scale.y = 高的比例转换

transform.rotation.z = 平面的旋转

opacity = 透明度

margin = 布局

zPosition = 翻转

backgroundColor = 背景颜色

cornerRadius = 圆角

borderWidth = 边框宽

bounds = 大小

contents = 内容

contentsRect = 内容大小

cornerRadius = 圆角

frame = 大小位置

hidden = 显示隐藏

mask

masksToBounds

opacity

position

shadowColor

shadowOffset

shadowOpacity

shadowRadius

...

转载于:https://www.cnblogs.com/liuluoxing/p/5765089.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值