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.

Up vote 1 down vote favorite share g+ share fb share tw.

I have a UIScrollView's paging enabled and set its clipToBounds = NO so that I can see outside current page. What I want is to enable the user to scroll the UIScrollView on its entire visible area, not only the part of current page. How can I implement this?

Thanks. P.S. According to apple's documentation (developer.apple.com/library/ios/#DOCUMEN...), if the value of pagingEnabled property is YES, the scroll view stops on multiples of the scroll view’s bounds when the user scrolls. This means I cannot just resize the UIScrollView to get what I want without compromising paging functionality, right?

Ios link|improve this question edited Aug 7 '11 at 14:04 asked Aug 7 '11 at 13:44AKFish103 50% accept rate.

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.

Will try. Thanks. – AKFish Aug 7 '11 at 15:29 Solved as you suggested.

Thanks. – AKFish Aug 8 '11 at 4:52.

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); }.

My understanding is that the UIScrollView will use its size to calculate the paging, so resizing it will compromise the paging functionality. Thanks anyway. – AKFish Aug 7 '11 at 13:59 You can increase contentSize accordingly and correct subviews positions.

– Evgeniy Shurakov Aug 7 '11 at 14:09 Already tried. And getting the contentSize right is essential for paging. My testing result is that the UIScrollView will only response to the touch events inside the bounding area of its frame, and the contentSize has no effect on this issue at all.

– AKFish Aug 7 '11 at 14:18.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions