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?
P.S.
According to Apple's documentation (https://developer.apple.com/documentation/uikit/uiscrollview), 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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With