Tha*_*nks 5 iphone cocoa-touch core-animation uikit timespace
他们说:
计时协议提供了使用以下两个属性在动画持续时间一定秒数内启动动画的方法:beginTime 和 timeOffset。beginTime 指定动画应开始的持续时间的秒数,并缩放到动画层的时间空间。timeOffset 指定附加偏移量,但在本地活动时间中指定。两个值相结合来确定最终的起始偏移。
我了解时空。但我在这里很难理解他们的话。
“缩放到动画层的时空。”
可以说我有这个:
那么0.25秒后就会实时开始?(双倍超级层速度,双倍子层速度,所以我们有四倍速度。动画师的本地速度是 1。所以仍然是四倍速度。)。
并且 timeOffset 被规定为“以本地活动时间”。他们的意思是被速度扭曲的时间?即,如果动画对象的速度属性为 1.0,这就是这里的本地活动时间?
当地的活跃时间对我来说确实意味着很多不同的事情。例如时钟时间,或者整个时空层次结构中的时间,它如何影响底部的时间。如果有人能在这里指出详细信息,那就太好了。
小智 3
查看核心动画的标题;特别是CAMediaTiming.h:
/* The CAMediaTiming protocol is implemented by layers and animations, it
* models a hierarchical timing system, with each object describing the
* mapping from time values in the object's parent to local time.
*
* Absolute time is defined as mach time converted to seconds. The
* CACurrentMediaTime function is provided as a convenience for querying the
* current absolute time.
*
* The conversion from parent time to local time has two stages:
*
* 1. conversion to "active local time". This includes the point at
* which the object appears in the parent's timeline, and how fast it
* plays relative to the parent.
*
* 2. conversion from active to "basic local time". The timing model
* allows for objects to repeat their basic duration multiple times,
* and optionally to play backwards before repeating. */
Run Code Online (Sandbox Code Playgroud)
另外(来自对属性的评论)
/* The rate of the layer. Used to scale parent time to local time, e.g.
* if rate is 2, local time progresses twice as fast as parent time.
* Defaults to 1. */
@property float speed;
/* Additional offset in active local time. i.e. to convert from parent
* time tp to active local time t: t = (tp - begin) * speed + offset.
* One use of this is to "pause" a layer by setting `speed' to zero and
* `offset' to a suitable value. Defaults to 0. */
@property CFTimeInterval timeOffset;
Run Code Online (Sandbox Code Playgroud)
所以,看来你的解释是正确的。