如何使用触摸旋转图像

Kum*_*onu 2 iphone

任何人都可以告诉我,如何根据用户给出的触摸旋转视图....

我的意思是我想像旧电话那样做出类似的外观(按下并旋转拨号......)......替代文字

我很清楚如何旋转,但根据这种情况无法旋转.....

nac*_*o4d 5

您只需要一个只有拨号图像的视图.

This view has a center C(x,y)
First, the view will be touched at coordinate T0(x,y)

if the x and y is within the circle do the tracking:
    Then the finger will move to coordinate Tn(x,y) 
    Find the angle made up by Tn(x,y) C(x,y) T0(x,y)  //(See below for a reference)
    and do the rotation using that angle as you already know ;)
else
   do nothing since the touch is not in the dial 
Run Code Online (Sandbox Code Playgroud)

参考:如何从三个点计算角度