我想在检测到第二次触摸后停止滚动并用我自己的捏合手势处理触摸。我在滚动视图中试过这个:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
if(event.allTouches.count > 2)self.panGestureRecognizer.enabled = NO;
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
if(event.allTouches.count > 2)self.panGestureRecognizer.enabled = YES;
}
但它不起作用。
试试这个:
scroll.panGestureRecognizer.maximumNumberOfTouches = 1;
但什么都没有