0
任何人知道的一种方式来获得当前触摸位置(不启动或结束位置),同时用户在刷卡?获取触摸位置,同时刷卡
有点像
-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
NSLog(@"%f", scrollView.contentOffset.x);
}
但对于UISwipeGestureRecognizer
谢谢,
最大
任何人知道的一种方式来获得当前触摸位置(不启动或结束位置),同时用户在刷卡?获取触摸位置,同时刷卡
有点像
-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
NSLog(@"%f", scrollView.contentOffset.x);
}
但对于UISwipeGestureRecognizer
谢谢,
最大
使用PanGestureRecognizer
- (void)onDraggingLetter:(UIPanGestureRecognizer *)panGR {
CGPoint translation = [panGR translationInView:baseView];
if (panGR.state == UIGestureRecognizerStateBegan) {
} else if (panGR.state == UIGestureRecognizerStateChanged) {
}
else if (panGR.state == UIGestureRecognizerStateEnded) {
}
}
的UISwipeGestureRecognizer
类只提供了手势和所述方向的起点。然而,UIPanGestureRecognizer
重复调用它相关的操作方法,你可以得到手势的当前位置(使用locationInView:
)各一次。
的,你必须使用'PanGestureRecognizer' ... – Venkat
UIGestureRecognizer已'locationInView' – Larme
@Mountain狮子:谢谢,它完美的作品。如果你想发布答案,我会接受它。 – masgar