How do you move a CALayer instantly (without animation)

前端 未结 5 1933
感情败类
感情败类 2020-12-12 12:51

I\'m trying to drag a CALayer in an iOS app.

As soon as I change its position property it tries to animate to the new position and flickers all over the

5条回答
  •  一整个雨季
    2020-12-12 13:14

    You can also use the convenience function

    [CATransaction setDisableActions:YES] 
    

    as well.

    Note: Be sure to read the comments by Yogev Shelly to understand any gotchas that could occur.

提交回复
热议问题