UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(pan:)];
[self addGestureRecognizer:panRecognizer];
- (void)pan:(UIPanGestureRecognizer *)gesture {
NSLog(@"%f", [gesture translationInView:self].x);
}
上面的代码会记录我当前平移的相对位置,但是我怎样才能获得我所在视图的绝对位置?ios UIPanGestureRecognizer指针位置
我只是想将UIImageView
滑动到用户手指的任何位置。
你说的* *“为我在视图中的绝对位置”是什么意思? – sch 2012-03-12 22:27:19