如何穿透一个view响应下面的view的touch事件
展开全部
在view里面继承 直接返回superview
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event{
UIView *view = [super hitTest:point withEvent:event];
NSLog(@"%@",view);
NSLog(@"%@",view.superview.superview);
if (view) {
return view.superview.superview;//view.superview; or view.superview.superview; or view.superview.superview.superview;... if has
}else
return nil;
}
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event{
UIView *view = [super hitTest:point withEvent:event];
NSLog(@"%@",view);
NSLog(@"%@",view.superview.superview);
if (view) {
return view.superview.superview;//view.superview; or view.superview.superview; or view.superview.superview.superview;... if has
}else
return nil;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询