美文网首页
笔记-子视图超出父视图

笔记-子视图超出父视图

作者: 小星星吃KFC | 来源:发表于2018-01-25 10:46 被阅读0次

- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event{
    
    UIView *view = [super hitTest:point withEvent:event ];
    if (view == nil) {
        for (UIView *subView in self.subviews) {
            CGPoint tp = [subView convertPoint:point fromView:self];
            if (CGRectContainsPoint(subView.bounds, tp)) {
                view = subView;
            }
        }
    }
    return view;
}

相关文章

网友评论

      本文标题:笔记-子视图超出父视图

      本文链接:https://www.haomeiwen.com/subject/kyomaxtx.html