最近有一个水机冲洗动画,发现动画开始时,从前台切换到后台,然后立马从后台切换到前台,这时动画停止了,只要加上这句代码就行:
animation.removedOnCompletion = NO;
官方解释:/* When true, the animation is removed from the render tree once its
- active duration has passed. Defaults to YES. */
当为真时,一旦活动持续时间已过,动画将从呈现树中删除。默认值为YES。
网友评论