UIGestureRecognizer blocks subview for handling touch events

后端 未结 10 1058
北恋
北恋 2020-11-28 19:32

I\'m trying to figure out how this is done the right way. I\'ve tried to depict the situation: \"enter

10条回答
  •  萌比男神i
    2020-11-28 20:12

    The blocking of touch events to subviews is the default behaviour. You can change this behaviour:

    UITapGestureRecognizer *r = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(agentPickerTapped:)];
    r.cancelsTouchesInView = NO;
    [agentPicker addGestureRecognizer:r];
    

提交回复
热议问题