How can I customize paging behavior in UIScrollView using pagingEnabled = YES?

The documentation says:

If the property value is YES, the scroll view stops at multiples when the user scrolls. Default value: NO.

ok it's really nice that it stops at multiples of view boundaries when the user scrolls;) But how many multiples? how is it calculated? I am getting really weird behavior. I have 15 small 50x50 images aligned vertically. How can I configure it to stop at every 50 scroll items or every image? it stops once at the top, once in the middle, and once at the end. This is not the behavior I was expecting.

+1


source to share


1 answer


it stops at every multiple of the boundaries. That is, if your scrollview is limited to 0.0100,100, it will stop at every multiple of 100 until the end of the content area. Assuming the origin is 0 (0 * 100), one swipe pattern will give you a value of 0.100 (or 100.0 or 100.100 if directionLock is not enabled).

To debug this removal, I will need to see the borders, the rect content of your scrollview, and the frames of all the subview images in the content frame.



I suspect that your scrollview is scrolling to it, restricting your subzones to non-short frames - if they don't match, you'll have to implement the paging yourself.

+3


source







All Articles