iOS develop. How to extend UIScrollView's scroll event responding area?

Put the scrollview into a uiview and disable clipsToBounds of the scrollview. the scrollview must be the size you want for paging. you will see the content outside of the scrollview but paging wil still be the same. You can activate clipsToBounce for the outside view to limit the size of the scrollview.

Overwrite the hitTest of the view to redirect the touches to the scrollview... then you will be able to also scroll by touching outside of the scrollview.


Why don't you resize your scrollView so it'll fit the area you need?

Not sure if it'll help, but try to override UIScrollView pointInside method

- (BOOL) pointInside:(CGPoint)point withEvent:(UIEvent *)event {
    CGRect newBounds = self.bounds;
    newBounds = CGRectInset(bounds, 0, -100.0f);
    return CGRectContainsPoint(newBounds, point);
}

Tags:

Ios