如何在iCarousel中为气缸内的车轮旋转设置定时器(How can i set timer for wheel rotation in cylinder for iCarousel)

编程入门 行业动态 更新时间:2024-10-05 21:17:42
如何在iCarousel中为气缸内的车轮旋转设置定时器(How can i set timer for wheel rotation in cylinder for iCarousel)

我在我的项目中使用iCarousel。 那么有什么方法我可以设置计时器,而我滚动圆柱轮。 我需要保持车轮旋转5秒钟。需要滚动动画直到那。

I am using iCarousel in my project. So is there a way i can set timer , while i scroll the Cylinder wheel. I need to keep the wheel rotated for 5 seconds.Need the scrolling animation until that.

最满意答案

好吧,如果您仔细阅读iCarousel的文档,您会发现某些方法包括iCarousel从一个索引移动到另一个索引所需的持续时间,即 -

- (void)scrollToItemAtIndex:(NSInteger)index duration:(NSTimeInterval)scrollDuration;

此方法允许您控制轮播滚动到指定索引所需的时间。

- (void)scrollByNumberOfItems:(NSInteger)itemCount duration:(NSTimeInterval)duration;

此方法允许您将旋转木马滚动固定距离,以旋转木马项目宽度测量。 可以为itemCount指定正值或负值,具体取决于您要滚动的方向。 iCarousel可以优雅地处理边界问题,因此如果您指定的距离大于旋转木马中的项目数量,滚动将在到达旋转木马末端时被钳制(如果禁用包装)或无缝环绕。

- (void)scrollToOffset:(CGFloat)offset duration:(NSTimeInterval)duration;

这与scrollToItemAtIndex:的工作方式相同,但允许您滚动到小数偏移。 如果您希望获得非常精确的动画效果,这可能很有用。 请注意,如果scrollToItemBoundary属性设置为YES,则在调用此方法后,轮播将自动滚动到最近的项索引。 无论如何。

- (void)scrollByOffset:(CGFloat)offset duration:(NSTimeInterval)duration;

这与scrollByNumberOfItems:的工作方式相同,但允许您滚动一小部分项目。 如果您希望获得非常精确的动画效果,这可能很有用。 请注意,如果scrollToItemBoundary属性设置为YES,则无论如何,在您调用此方法后,轮播将自动滚动到最近的项索引。

请检查这些方法。 希望他们帮忙......

Well if you read the documentation of The iCarousel carefully you will find that there are certain methods which include the time duration it takes for the iCarousel to move from one index to the other, namely -

- (void)scrollToItemAtIndex:(NSInteger)index duration:(NSTimeInterval)scrollDuration;

This method allows you to control how long the carousel takes to scroll to the specified index.

- (void)scrollByNumberOfItems:(NSInteger)itemCount duration:(NSTimeInterval)duration;

This method allows you to scroll the carousel by a fixed distance, measured in carousel item widths. Positive or negative values may be specified for itemCount, depending on the direction you wish to scroll. iCarousel gracefully handles bounds issues, so if you specify a distance greater than the number of items in the carousel, scrolling will either be clamped when it reaches the end of the carousel (if wrapping is disabled) or wrap around seamlessly.

- (void)scrollToOffset:(CGFloat)offset duration:(NSTimeInterval)duration;

This works the same way as scrollToItemAtIndex:, but allows you to scroll to a fractional offset. This may be useful if you wish to achieve a very precise animation effect. Note that if the scrollToItemBoundary property is set to YES, the carousel will automatically scroll to the nearest item index after you call this method. anyway.

- (void)scrollByOffset:(CGFloat)offset duration:(NSTimeInterval)duration;

This works the same way as scrollByNumberOfItems:, but allows you to scroll by a fractional number of items. This may be useful if you wish to achieve a very precise animation effect. Note that if the scrollToItemBoundary property is set to YES, the carousel will automatically scroll to the nearest item index after you call this method anyway.

Please check these methods . Hope they help...

更多推荐

本文发布于:2023-07-17 10:06:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1142724.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:气缸   定时器   车轮   中为   如何在

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!