How do you stop a UIScrollView
at specific point? That is, set the final position of the UIScrollView
after user interaction?
Specifically, how can you set intervals along a horizontal UIScrollView
, so that the it will only stop at these points?
I hope what I have said is clear enough.
to achieve this u need to enable the paging of the scrollview
For example:
[scrollView setContentSize:CGSizeMake(640, 161)];
[scrollView setPagingEnabled:YES];
here, width of scrollview is 640 (twice of width of iphone screen), if paging is enabled it will divide it equally depending on the width. So as we scroll to this position it will stop at the particular offset.
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