Pergunta

So I have looked over a bunch of other questions that could possible be duplicates. But none of the solutions that have been mentioned seem to work. Also, the answers tend to be scattered and incomplete.

So, I have a UIView inside of a subclassed UIScrollView. All I need to do is have the UIScrollview ignore all forms of gesture that can occur with 3 fingers and, instead, pass it on to the UIView inside. Could someone help me with this.

Foi útil?

Solução

You need to subclass the scrollview to accomplish this. I tested this technique with a UITableView just now and it worked.

@interface OneTwoTouchScrollView : UIScrollView
@end

@implementation OneTwoTouchScrollView

-(BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer*)recognizer
{
    return recognizer.numberOfTouches < 3 && [super gestureRecognizerShouldBegin:recognizer];
}

@end
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top