Reputation: 634
I'm a beginner to programming, and I need to make a UIScrollView
with paging enabled, but I don't want to make the paging be page by page... I want to make the user scroll and when he/she stops scrolling the UIScrollView
stops on one of the views that I have already created in the main UIScrollView
.
In addition to this, I want to make an infinite UIScrollView
with this style (check the image) & Change the 'gravity' (stop speed) when scrolling through a UIScrollView
with paging enabled?
https://i.sstatic.net/JdLRL.jpg
I want to be able to scroll through it many items based on the flick speed. Thanks!
Upvotes: 0
Views: 116
Reputation: 14068
If it is really about scrolling only (the linked jpeg example may suggest it different) then you could do pretty much the same as Tutorials suggest about paging. Create a scroll view that hosts 3 views. One to the right and one to the left of the view that is currently visible. (You may want to go for 5 depending on the exact layout.)
Assuming the user scrolls from right to left. And your individual views are A, B and C. B is visible at the beginning. The user scrolls in a way that be moves out of view and c becomes visible. When c is fully visible latest then you could re-arrange the scroll view. Get rid of a, create view d and setup the scroll area in a way that B, C and D are the new subviews and C is visible. And so on and so on ...
Upvotes: 1