2011-12-14 14 views

回答

12

當iCarousel停止移動它調用下面的委託方法:

- (void)carouselDidEndScrollingAnimation:(iCarousel *)carousel; 

在該方法中,你可以通過調用

NSInteger frontmostViewIndex = carousel.currentItemIndex; 

拿到最前面的視圖索引如果您需要實際查看本身,只是通過以下方法:

UIView *frontmostView = [carousel itemViewAtIndex:carousel.currentItemIndex]; 

或使用此屬性,它在內部做同樣的事情:

UIView *frontmostView = carousel.currentItemView; 

這有幫助嗎?

+1

謝謝,非常感謝。我並不期待尼克洛克伍德自己來幫助我。如果它實際上是你而不是我必須說你已經開發了一個可重用的東西。再次感謝。 :D –

+12

那麼如果我不支持自己的東西,那麼誰會呢? ;-) –

+0

以下任何想法http://stackoverflow.com/questions/43164687/carousel-index-are-not-in-order – hotspring

相關問題