关于UIRotationGestureRecognizer

时间:2013-01-03 00:44:11

标签: iphone objective-c ios ipad uigesturerecognizer

我可以获得UIRotationGestureRecognizer的两个手指的中点坐标吗?或者每个手指的位置?谢谢。

2 个答案:

答案 0 :(得分:4)

你可以得到。

UIRotationGestureRecognizer的文档显示了属性velocityrotation

这特定于轮换。

但您可以使用UIGestureRecognizer中的这些方法......

Getting the Touches and Location of a Gesture
– locationInView:
– locationOfTouch:inView:
– numberOfTouches

获取接触点和位置。

通过这些,您可以轻松计算中点。

答案 1 :(得分:1)

UIRotationGestureRecognizer扩展了UIGestureRecognizer,它有两种方法:numberOfToucheslocationOfTouch:inView:。使用这些来获取每个手指的位置。从那里你可以计算一个中心。