What exactly does removedOnCompletion = NO do?

前端 未结 4 1765
闹比i
闹比i 2021-02-02 00:35

CAAnimation provides the removedOnCompletion property which defaults to YES.

Let\'s recognize these facts:

A) Core Animation only affects the Presentation Tree,

相关标签:
4条回答
  • 2021-02-02 00:56

    The presentation layer of the view is effected by the animation even it stopped. When remove the animation, the presentation layer will be revert to the value of model layer of the view, so you will get a result as an0 pointed.

    0 讨论(0)
  • 2021-02-02 00:58

    removedOnCompletion:

    Basically, is the animation removed from the layer's actions when that animation is done.

    YES - If you intend to use the animation only once, you do not need to use the delegate method to remove the animation from the layer upon completion.

    fillMode:

    This property controls what happens visually when the animation is completed, depending on the type of fill mode specified.

    0 讨论(0)
  • 2021-02-02 01:10

    If removedOnCompletion is YES, the animation will be removed on completion and there is nothing to "fill forward" at all. So if you want to use fillMode you must set removedOnCompletion to NO.

    0 讨论(0)
  • 2021-02-02 01:14

    removedOnCompletion = YES really is just a shortcut. In most cases I'd discourage using it, but rather set the model values as well.

    Animations that linger around although you don't make use of them may consume energy and bandwidth and mess your logic up, since you can no longer inspect animationKeys to poll (should you ever need that) whether they're already finished.

    0 讨论(0)
提交回复
热议问题