0

I've set out to make a rotating roller uipicker like these. I know how to rotate a UILabel but I need help with the math to know how to progressively rotate the UILabel's based on their position on a circle of x circumference? Any math whizzes out there or am I over-thinking it?

What I'm thinking so far:

  • I need to find the angle of the tangent of a circle at a particular degree so I know which angle to rotate the label (this shouldn't be hard)
  • Hard bit will be working out the x/y coordinates and working how how much space to put between each value

EDIT

I'm thinking it might be easier to treat it as a half octagon and I can tweak the angles manually until it looks good. Then the only problem is working out how to animate between the positions but that won't be hard as it is just a rotate/move animation.

4

1 回答 1

1

Here's a good tutorial on how to implement it.

http://www.raywenderlich.com/9864/how-to-create-a-rotating-wheel-control-with-uikit

于 2012-12-13T03:41:10.567 回答