ios 点击手势在某些子视图上不响应

1.签订代理

2.实现代理方法(加单击手势的视图上方有子视图noResponseView,但noResponseView不响应单击手势)

-(BOOL) gestureRecognizer:(UIGestureRecognizer*)gestureRecognizer shouldReceiveTouch:(UITouch*)touch
{
       if ([touch.view isDescendantOfView:noResponseView]])
      {
         return NO;
      }
      else
      {
         return YES;
      }
}

你可能感兴趣的:(ios 点击手势在某些子视图上不响应)