开发者

Applying speed and number of rotations for CABasicAnimation

开发者 https://www.devze.com 2023-02-26 09:47 出处:网络
I am trying to mimic the rotation of the bottle in Spin the Coke app and pie-chart in the RoambieApp. . I wanted to rotate a view as per the touches and swipes of the user on that view.

I am trying to mimic the rotation of the bottle in Spin the Coke app and pie-chart in the Roambie App. . I wanted to rotate a view as per the touches and swipes of the user on that view.

What I currently do it:

  1. Get the time when a touch Began and ended. (and swipe)
  2. G开发者_如何学编程et all the coordinates of the touch or swipe and find the total distance.

I believe that the spin the coke app animates the bottles based on the distance and time taken for the swipe or touch. But I am not sure how they could have done.

I wanted the view to rotate faster initially, then slowdown and stop finally.

Please share your thoughts on how this problem could be solved?


Take a look at keyframe animation: you have to build your animation manually but you can achieve any result you want.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号