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