谁能告诉我我该如何相对于用户给出的触摸旋转视图...。

我的意思是我想像旧电话一样出现(按并旋转拨号...)...

我知道如何旋转,但是根据这种情况无法旋转.....

最佳答案

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

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


参考:How to calculate an angle from three points

10-08 05:35
查看更多