美文网首页
iOS CAPropertyAnimation 可用的 anim

iOS CAPropertyAnimation 可用的 anim

作者: GloryMan | 来源:发表于2018-01-09 15:34 被阅读130次

    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

    相关文章

      网友评论

          本文标题:iOS CAPropertyAnimation 可用的 anim

          本文链接:https://www.haomeiwen.com/subject/iwxgnxtx.html