Search code examples
iphoneipadicarousel

How to set ICarousel to slide one time for one one image


I am using ICarousel to make my Electronic Album. When you slide the album , the default setting by ICarousel is that it will move to some distance. What I need is slide one time for one one image only. I found ICarousel is not based on ScrollView , So I can not figure out how to achieve my purpose, is someone who know about it?


Solution

  • I would recommend turning off the native scrolling and attaching a PanGestureRecognizer that utilizes the scrollByNumberofItems method.

    [iCarousel setScrollEnabled:NO];
    

    Then inside your gestureRecognizer:

    [iCarousel scrollByNumberOfItems:1 duration:0.25];
    

    I tried this myself and it worked great.