Iphone 在刷卡时获得触摸位置
有人知道在用户刷卡时获取当前触摸位置(不是开始或结束位置)的方法吗 类似于Iphone 在刷卡时获得触摸位置,iphone,uigesturerecognizer,uiswipegesturerecognizer,Iphone,Uigesturerecognizer,Uiswipegesturerecognizer,有人知道在用户刷卡时获取当前触摸位置(不是开始或结束位置)的方法吗 类似于 -(void)scrollViewDidScroll:(UIScrollView *)scrollView{ NSLog(@"%f", scrollView.contentOffset.x); } 但是对于UISweepGestureRecognitor 谢谢 MaxUISweepGestureRecognitor类仅提供手势和方向的起点。但是,uipangestureerecognizer会反复调用其关联的动
-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
NSLog(@"%f", scrollView.contentOffset.x);
}
但是对于UISweepGestureRecognitor
谢谢
MaxUISweepGestureRecognitor类仅提供手势和方向的起点。但是,
uipangestureerecognizer
会反复调用其关联的动作方法,您每次都可以获取手势的当前位置(使用locationInView:
) 使用PanGestureRecognizer
- (void)onDraggingLetter:(UIPanGestureRecognizer *)panGR {
CGPoint translation = [panGR translationInView:baseView];
if (panGR.state == UIGestureRecognizerStateBegan) {
} else if (panGR.state == UIGestureRecognizerStateChanged) {
}
else if (panGR.state == UIGestureRecognizerStateEnded) {
}
}
为此,您必须使用
PangestureRecognitizer
…UIgestureRecognitizer具有locationInView
。@山狮:谢谢,它工作完美。如果你想把答案贴出来,我会接受的。