carousel

Discussion in 'iOS Programming' started by chhoda, May 26, 2009.

  1. chhoda macrumors 6502

    Joined:
    Oct 25, 2008
    #1
    I wanna do a carousel of images from where the user selects an image. I dont wanna use picker control. i tried using a scrollview and do that, but selection part is not happening, is there anyway i can bring the start item after end item ?

    any examples any body has come across ?

    --CH
     
  2. JimBobBennett macrumors member

    Joined:
    May 4, 2009
    #2
    Do you mean similar to the apple photo browser?

    If so, use a UIScrollView containing UIImageViews with paging enabled.

    If you want it to loop round, then I solved this problem by handling the scrolled message on the delegate and if the scroll is all the way to the end, change the images in the image views, then move back to the centre.

    E.g.

    Scroll View 960 wide, paging enabled.
    Contains 3 image views, with images 1, 2, 3 in them
    On the scroll delegate message - if content offset is 640 (so rightmost image), then set the imageviews to contain 2, 3, 1 and set the content offset back to 320.
     

Share This Page