【发布时间】:2012-03-12 22:25:16
【问题描述】:
UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(pan:)];
[self addGestureRecognizer:panRecognizer];
- (void)pan:(UIPanGestureRecognizer *)gesture {
NSLog(@"%f", [gesture translationInView:self].x);
}
上面的代码会记录我当前平移的相对位置,但是我怎样才能得到我所在视图的绝对位置呢?
我只是想将UIImageView 滑动到用户手指所在的位置。
【问题讨论】:
-
“我所在的视图的绝对位置”是什么意思?
标签: ios uipangesturerecognizer