如何屏蔽父view的touch事件到,并且响应self的touch
-(UIView*)hitTest:(CGPoint)pointwithEvent:(UIEvent*)event{CGMutablePathRefpath=CGPath...
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event{ CGMutablePathRef path = CGPathCreateMutable(); CGPathMoveToPoint(path,NULL,0,0); CGRect rect = CGRectMake(0, 100, 320, 40); CGPathAddRect(path, NULL, rect); if(CGPathContainsPoint(path, NULL, point, NO)) { [self.superview touchesBegan:nil withEvent:nil]; } CGPathRelease(path); return self;}
展开
若以下回答无法解决问题,邀请你更新回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询