What's the effect of fillMode being kCAFillModeBackwards?
kCAFillModeBackwards
The receiver clamps values befor开发者_运维技巧e zero to zero when the animation is completed.
What does the meaning of "clamping values before zero to zero"? A simple example would be appreciated.
Since no one gave me an answer and the documentation of fillMode is really bad, I did a research and re-document it here.
kCAFillModeRemoved
The receiver does not appear until it begins and is removed from the presentation when it is completed.
kCAFillModeForwards
The receiver does not appear until it begins but remains visible in its final state when it is completed.
kCAFillModeBackwards
The receiver appears in its initial state before it begins but is removed from the presentation when it is completed.
kCAFillModeBoth
The receiver appears in its initial state before it begins and remains visible in its final state when it is completed.
Default : kCAFillModeRemoved - plays the animation at begin time and simply removes animation from view layer.
kCAFillModeBackwards - loads the animation first frame until animation begins and then removes animation completely from view layer after completion.
kCAFillModeForwards - opposite of above. Keep last frame of animation, unless explicitly removed, even after animation completes.
kCAFillModeBoth - kCAFillModeForwards + kCAFillModeBackwards
精彩评论