Disabling animation when changing layer/view properties?

前端 未结 2 1240
心在旅途
心在旅途 2021-02-14 20:27

I composed a kind of animation by adding several layers to a UIView. Those layers shall be set visible or invisible by a script.

The script is based on objects that impl

2条回答
  •  抹茶落季
    2021-02-14 20:32

    Just wrap the code where you are making the change.

    [CATransaction begin];
    [CATransaction setAnimationDuration:0];
    
    [thelayer setAlpha:0];
    
    [CATransaction commit];
    

提交回复
热议问题