- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
UIView view = [super hitTest:point withEvent:event];
BOOL hitHead = point.y < (NNHeadViewHeight - self.offset.y);
if (hitHead || !view) {
self.scrollEnabled = NO;
if (!view) {
for (UIView subView in self.subviews) {
if (subView.frame.origin.x == self.contentOffset.x) {
view = subView;
}
}
}
return view;
} else {
self.scrollEnabled = YES;
return view;
}
}
网友评论