简体   繁体   English

如何将 iCarousel autoScrollDirection 从左到右更改为从右到左

[英]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 :我浏览了许多链接并检查了iCarousel 从右到左滚动也从左到右移动,但没有解决我的问题:

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.我正在使用启用自动滚动的iCarousel自定义库,但在此库中,它只允许从左到右滚动方向进行自动滚动,我的问题是我希望它反向(从右到左)方向。请任何人帮我解决这个问题。

Thank you谢谢

change the autoscroll value from 1 to -1将自动滚动值从 1 更改为 -1

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

If you will set autoscroll property so, it will scroll every time.如果您将设置autoscroll属性,则每次都会滚动。

Just add only line of code you will get the direction as per your want.只需添加一行代码,您就可以根据需要获得方向。

If you want to scroll with RTL support.如果您想使用 RTL 支持滚动。 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;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 需要更改从左到右然后从右到左的顺序转换 - Need to change segue transition from left to right and then right to left 如何从右到左而不是从左到右显示 UICollectionView 的单元格? - How to display cells of UICollectionView from right to left instead of left to right? 如何通过从UIViewController向右或向左滑动来更改UIImageView中的图像 - How to change image from UIImageView by sliding right or left from UIViewController UIImage从左向右和从右向左卷曲 - UIImage curl from left to right and right to left 在Splitviewcontroller中从左到右更改Masterview的位置 - change the position of Masterview from left to right in Splitviewcontroller 从右到左(希伯来语)更改视图控制器, - change view controller from right to left (Hebrew), 如何在键盘中更改为从右到左语言 - How to change to Right-to-Left language in keyboard 如何在Swift 4中从左到右更改导航动画? - how to change navigation animation to left to right in swift 4? 如何从左到右更改带有动画的CALayer的宽度? - How to change the width of a CALayer with animation from left to right? 从左到右更改导航标题位置 - Change navigation title position from left to right
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM