Re: Controlling iOS scrolling
On Mon, 09 Jan 2012 09:09:17 +0000, Ken Tabb <k.j.tabb...> said:
> Morning folks & Happy New Year,
> I've got an iOS app that needs to have a UIScrollView containing a
> horizontal row of UIImageViews, all the same size. The UIScrollView
> will be a subclass as I need it to implement some additional
> behaviour, but I've got 2 questions which may already be built in (but
> I can't find anything relating to it):
>  Is there an easy way of looping the scrolling (so that you don't
> hit either end of scrolling, you keep going around and around)?
>  Is there any way to, upon decelerating, ensure that one of the
> imageviews is always centred in the scrollview? Ideally with swish
> decelerating taking place, looking like the user lined it up perfectly
> each time the scrolling comes to rest.
Enable paging and keep dynamically changing the content to the left and right of the page the user sees. That's how my JACTVocab app worked on iOS 3.1 and iOS 4, and I described the technique in my book. Later, the WWDC 2011 video on scrolling gave the same suggestion. When iOS 5 came along and gave me UIPageViewController, I scrapped my earlier architecture to use that instead; if you can afford to run iOS 5 only, I strongly suggest you do the same, as the earlier technique, though viable, is a heck of a lot of work. m.
matt neuburg, phd = <matt...>, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
Programming iOS 4!