0

任何人都知道在用户滑动时获取当前触摸位置(不是开始或结束位置)的方法吗?

类似的东西

-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
    NSLog(@"%f", scrollView.contentOffset.x);
}

但是对于 UISwipeGestureRecognizer

谢谢,

最大限度

4

2 回答 2

0

该类UISwipeGestureRecognizer仅提供手势的起点和方向。但是,反复调用它的关联动作方法,您每次UIPanGestureRecognizer都可以获得手势的当前位置(使用)。locationInView:

于 2013-01-16T13:10:48.633 回答
0

采用PanGestureRecognizer

- (void)onDraggingLetter:(UIPanGestureRecognizer *)panGR {
CGPoint translation = [panGR translationInView:baseView];

    if (panGR.state == UIGestureRecognizerStateBegan) {
    } else if (panGR.state == UIGestureRecognizerStateChanged) { 
    }
    else if (panGR.state == UIGestureRecognizerStateEnded) {
    }
}
于 2013-01-16T13:13:01.157 回答