rotate a UIView around its center but several times

前端 未结 4 1423
忘了有多久
忘了有多久 2020-12-01 06:43

I\'m trying to rotate some UIView around its center, so the simple code goes something like (in pseudocode):

[UIView beginAnimations:@\"crazyRo         


        
4条回答
  •  情歌与酒
    2020-12-01 07:29

    Getting a continuous spinning effect is a little tricky, but I describe a means to do it here. Yes, Core Animation seems to optimize transforms to the closest ending position within the unit circle. The method I describe there chains a few half-rotation animations together to make full rotations, although you do notice a slight stutter in the handoff from one animation to the next.

    Perhaps a CAKeyframeAnimation constructed with these half-rotation values would be the right way to go. Then you could also control acceleration and deceleration.

提交回复
热议问题