简体   繁体   中英

How to change iCarousel autoScrollDirection from left to right To Right to left

I have gone through many links and checked iCarousel right to left scroll moving to left to right too, but did not get any solution to my issue :

I am using iCarousel custom library with enabling Autoscroll but in this library, it only allows Left to right scroll direction for autoscroll, my issue is I want it in reverse (Right to left)direction.can anyone help me with this, please.

Thank you

change the autoscroll value from 1 to -1

carousel.autoscroll = -1.0
[carousel scrollToItemAtIndex:0 animated:YES];

If you will set autoscroll property so, it will scroll every time.

Just add only line of code you will get the direction as per your want.

If you want to scroll with RTL support. Add below line.

Sort your data model array in reverse order, so that the item you want to be first appears at the end of the array.

After loading the carousel, set its index to the last item, which you can do by calling

carousel.currentItemIndex = array.count - 1;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM