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):
    >
    > [1] 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)?
    >
    > [2] 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!
    http://www.apeth.net/matt/default.html#iosbook
previous month january 2012 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today