Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 0.60 KB  |  hits: 77  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. iOS UIScrollView clipToBounds = NO Subviews not detected
  2. - (UIView*)hitTest:(CGPoint)pt withEvent:(UIEvent*)event
  3. {
  4.     UIView *contentView = [self.subviews count] ? [self.subviews objectAtIndex:0] : nil;
  5.     return [contentView hitTest:pt withEvent:event];
  6. }
  7.        
  8. - (UIView )hitTest:(CGPoint)point withEvent:(UIEvent )event;
  9. {
  10. UIView *view = [super hitTest:point withEvent:event];
  11. for (UIView *subview in self.subviews) {
  12. if (view != nil &&
  13. view.userInteractionEnabled) break;
  14. CGPoint newPoint = [self convertPoint:point toView:subview];
  15. view = [subview hitTest:newPoint withEvent:event];
  16. }
  17. return view;
  18. }