- (UIView*)hitTest:(CGPoint)pointwithEvent:(UIEvent*)event
{
UIView*hitView = [superhitTest:pointwithEvent:event];
if(hitView ==self)
{
returnnil;
}
else
{
returnhitView;
}
}
hitTest方法每个视图都有的,重写一下该方法,就可以使该视图不接受事件
- (UIView*)hitTest:(CGPoint)pointwithEvent:(UIEvent*)event
{
UIView*hitView = [superhitTest:pointwithEvent:event];
if(hitView ==self)
{
returnnil;
}
else
{
returnhitView;
}
}
hitTest方法每个视图都有的,重写一下该方法,就可以使该视图不接受事件