`

时间、时间空间、CAAnimation

 
阅读更多

分解一个简单是动画,它只是在动画时间内简单的替换不同的值。Core Animation 为 animations 和layers提供了基础的时间函数,和高级的时间线特性。

 

media timing protocol

 

动画时间模型是用一个 CAMediaTiming 协议声明的,CAAnimation的类和它的子类都支持该协议。时间模型指定一个动画的 offset, duration, speed, and repeating behavior 。

 

CALayer 类同样也支持CAMediaTiming协议,运行一个layer相对于他的superlayer定义一个时间空间,类似于一个相当的坐标空间。This concept of a layer-tree timespace provides a scalable timeline that starts at the root layer, through its descendants. Since an animation must be associated with a layer to be displayed, the animation's timing is scaled to the timespace defined by the layer.(动画必须依附在一个layer上别显示,并且该动画的时间,被映射到定义该动画的layer的时间空间内)。

 

一个animation 或者 层的speed属性指定一个缩放比例。例如为层定义一个10秒的动画,该层的speed值为2,该动画将显示5秒

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics