iOS CAPropertyAnimation 可用的 animationWithKeyPath


title: iOS CAPropertyAnimation 可用的 animationWithKeyPath
date: 2016-07-21 18:06:40
categories:

  • Code
  • iOS
    tags:
  • CAPropertyAnimation
  • CABasicAnimation
  • CAKeyframeAnimation

在 iOS 动画开发中经常使用到的 animationWithKeyPath字符串,在这里记录一下,下面是只是其中的一部分。

- #define angle2Radian(angle) ((angle)/180.0*M_PI)

// 旋转
transform.rotation.x 围绕x轴翻转 参数:角度 angle2Radian(4)

transform.rotation.y 围绕y轴翻转 参数:同上

transform.rotation.z 围绕z轴翻转 参数:同上

transform.rotation 默认围绕z轴

// 缩放
transform.scale.x x方向缩放 参数:缩放比例 1.5

transform.scale.y y方向缩放 参数:同上

transform.scale.z z方向缩放 参数:同上

transform.scale 所有方向缩放 参数:同上

// 平移
transform.translation.x x方向移动 参数:x轴上的坐标 100

transform.translation.y x方向移动 参数:y轴上的坐标

transform.translation.z x方向移动 参数:z轴上的坐标

transform.translation 移动 参数:移动到的点 (100,100)

// 其他属性
opacity 透明度 参数:透明度 0.5

backgroundColor 背景颜色 参数:颜色 (id)[[UIColor redColor] CGColor]

cornerRadius 圆角 参数:圆角半径 5

borderWidth 边框宽度 参数:边框宽度 5

bounds 大小 参数:CGRect

contents 内容 参数:CGImage

contentsRect 可视内容 参数:CGRect 值是0~1之间的小数

position 锚点位置

shadowColor 阴影颜色

shadowOffset 阴影的偏移量

shadowOpacity 阴影的透明度

shadowRadius 阴影的圆角

官方支持的keyPath

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容