views:

37

answers:

1

Hi, I want to create a rotating wheel menu which the user can use his/her finger to rotate the menu.

I understand how to rotate the circle but I have no idea how to rotate it when the user drags it using his/her finger in the right direction that hte user is dragging the wheel in.

Any help please?

Thank you!

+1  A: 

That's a matter of trigonometry. You need to find the heading from the wheels center to the touch location, then you let your wheel rotate to that heading.

It might help to convert the involved coordinates into "wheelview"s parent view coordinate system, to avoid confusion if the wheelview itself is the rotating part.

Toastor