iPhone "Move and scale"... and rotate?
I am trying to find a way to make some way for users to adjust their images for my app. I tried default "Move and Sc开发者_如何学Goale" but it doesn't seem to support rotation. what I want to do is making users to move, scale, and rotate the picture to fit in the overlay/silhouette. What should I do?
Have a look at the UIGestureRecognizer
class available in iOS4. This can be used to detect certain gestures like rotation, panning & pinching. Once the gesture has been detected it's up to you to add the correct transform to the picture for instance.
The gesture recognizers really are the way to go, no more touchesBegan/Ended madness. But they come at a cost, as they are iOS4 only.
Link: UIGestureRecognizer Class Reference
Refer to this code by Erica Sadun - https://github.com/erica/iphone-3.0-cookbook-/tree/master/C08-Gestures/14-Resize%20And%20Rotate/
精彩评论