Objective c 伊卡鲁塞尔线性无限效应?

Objective c 伊卡鲁塞尔线性无限效应?,objective-c,ios8,icarousel,Objective C,Ios8,Icarousel,我想问,如何创造一个线性无限效果的伊卡鲁塞尔? 我的意思是,它是线性和旋转式的结合。 例如,数字1-10以线性方式显示,然后10旁边是1 这可能吗?谢谢首先,通过实现 - (BOOL)carouselShouldWrap:(iCarousel *)carousel { //wrap all carousels return YES; } 接下来,您可以使用NSTimer启动滚动。例如: self.scrollTimer = [NSTimer scheduledTimerWithTimeInte

我想问,如何创造一个线性无限效果的伊卡鲁塞尔? 我的意思是,它是线性和旋转式的结合。 例如,数字1-10以线性方式显示,然后10旁边是1


这可能吗?谢谢

首先,通过实现

- (BOOL)carouselShouldWrap:(iCarousel *)carousel {
//wrap all carousels
return YES;
}
接下来,您可以使用NSTimer启动滚动。例如:

self.scrollTimer = [NSTimer scheduledTimerWithTimeInterval:10 target:self selector:@selector(scrollCarousel) userInfo:nil repeats:YES];

- (void)scrollCarousel {
 NSInteger newIndex=self.carousel.currentItemIndex++;
 if (newIndex > self.carousel.numberOfItems) {
   newIndex=0;
 }

 [self.carousel scrollToItemAtIndex:newIndex duration:5]; // takes 5 seconds to scroll

}