Reputation: 787
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
Upvotes: 3
Views: 945
Reputation: 26
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;
Upvotes: 0
Reputation: 2581
change the autoscroll value from 1 to -1
carousel.autoscroll = -1.0
[carousel scrollToItemAtIndex:0 animated:YES];
Upvotes: 3