Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS UIScrollView clipToBounds = NO Subviews not detected
    primarykey
    data
    text
    <p>I have a scroll view that is 256x256 in width/height. I have subviews of that scroll view stretching in both directions (left and right). I set clipToBounds to NO so I can see the items in the scroll view.</p> <p>When the user touches a space in the scrollview holder (the area that extends beyond the 256x256) I check the hittest and return the scrollView.</p> <p>My problem is the items on my scrollview are buttons, and if the button is not inside the 256x256 it is not receiving the touch events. How do I cycle through the buttons on the scrollview and then forward the events to the buttons?</p> <p>I'm doing like this <a href="https://stackoverflow.com/questions/3735218/paging-uiscrollview-with-peeking-neighbor-pages">Paging UIScrollView with peeking neighbor pages</a></p> <p>But my scrollview subviews aren't receiving events.</p> <p>I've tried all of the following in my view that is supposed to send events down the wire and my buttons will not receive the events. The event chain always stops at my UIScroll view - allowing me to scroll my items - but how do I forward events to the buttons from the scrollview?</p> <pre><code>- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { if ([self pointInside:point withEvent:event]) { return self.scrollView; } return nil; } - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { if ([self pointInside:point withEvent:event]) { return self.scrollView; } return nil; } - (UIView *) hitTest:(CGPoint) point withEvent:(UIEvent *)event { UIView* child = nil; if ((child = [super hitTest:point withEvent:event]) == self) { return self.scrollView; } return child; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload