IOS Animation-KeyPath值

IOS Animation-KeyPath值

keyPath值 说明 值类型

position

移动位置 CGPoint

opacity

透明度 0-1

bounds

变大与位置 CGRect

bounds.size

由小变大 CGSize

backgroundColor

背景颜色 CGColor

cornerRadius

渐变圆角 任意数值

borderWidth

改变边框border的大小

(图形周围边框,border默认为黑色)

任意数值
 

contents

 

改变layer内容(图片)

注意如果想要达到改变内容的动画效果

首先在运行动画之前定义好layercontents contents

CGImage
 

transform.scale

缩放、放大

 
0.0-1.0
 

transform.rotation.x

 

旋转动画(翻转,沿着X)

 

M_PI*n

 

transform.rotation.y

 

旋转动画(翻转,沿着Y)

M_PI*n
transform.rotation.z  旋转动画(翻转,沿着Z) M_PI*n
 

transform.translation.x

 

横向移动(沿着X轴)

任意数值
 

transform.translation.y

 

纵向移动(沿着Y轴)

任意数值 

 上面列列举了keypath值,但是实现可以看下面的文章:

 http://www.cnblogs.com/alunchen/p/5373820.html

  

原文地址:https://www.cnblogs.com/alunchen/p/5300075.html