
Untitled
By: a guest on
May 7th, 2012 | syntax:
None | size: 0.60 KB | hits: 77 | expires: Never
iOS UIScrollView clipToBounds = NO Subviews not detected
- (UIView*)hitTest:(CGPoint)pt withEvent:(UIEvent*)event
{
UIView *contentView = [self.subviews count] ? [self.subviews objectAtIndex:0] : nil;
return [contentView hitTest:pt withEvent:event];
}
- (UIView )hitTest:(CGPoint)point withEvent:(UIEvent )event;
{
UIView *view = [super hitTest:point withEvent:event];
for (UIView *subview in self.subviews) {
if (view != nil &&
view.userInteractionEnabled) break;
CGPoint newPoint = [self convertPoint:point toView:subview];
view = [subview hitTest:newPoint withEvent:event];
}
return view;
}