What kind of value is keyTime in an CAKeyFrameAnimation?

后端 未结 2 664
逝去的感伤
逝去的感伤 2021-02-02 03:08

For example I have this CAKeyFrameAnimation:

CALayer* theLayer = myView.layer;
    CAKeyframeAnimation* animation;
    animation = [CAKeyframeAnimation animation         


        
2条回答
  •  自闭症患者
    2021-02-02 03:53

    The value of keyTimes is a percent of the total duration. Valid values range between 0 and 1 (0% to 100%). Your last value of 1.6 is invalid.

    As an example, if a keyframe is supposed to happen 0.8 seconds into the animation that keyTime would be 0.5 given your duration of 1.6 seconds.

提交回复
热议问题