子控件超出父控件的事件响应

当子控件超出父控件的范围,那么点击超出的部分是不响应的,那么应该怎么办呢?

//父控件的处理
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { // 当前控件上的点转换到chatView上 CGPoint currentP = [self convertPoint:point toView:self.subView]; // 判断下点在不在chatView上 if ([self.subView pointInside:currentP withEvent:event]) { return self.subView; }else{ return [super hitTest:point withEvent:event]; } }

 

posted @ 2015-06-04 17:36  Emyin  阅读(639)  评论(0编辑  收藏  举报