1
我在我的應用程序中實現iCarousel,但不知何故,當旋轉木馬停止動畫時,無法弄清楚哪個視圖在前面。感謝您的幫助。如何確定Icarousel停在哪個視圖上?
我在我的應用程序中實現iCarousel,但不知何故,當旋轉木馬停止動畫時,無法弄清楚哪個視圖在前面。感謝您的幫助。如何確定Icarousel停在哪個視圖上?
當iCarousel停止移動它調用下面的委託方法:
- (void)carouselDidEndScrollingAnimation:(iCarousel *)carousel;
在該方法中,你可以通過調用
NSInteger frontmostViewIndex = carousel.currentItemIndex;
拿到最前面的視圖索引如果您需要實際查看本身,只是通過以下方法:
UIView *frontmostView = [carousel itemViewAtIndex:carousel.currentItemIndex];
或使用此屬性,它在內部做同樣的事情:
UIView *frontmostView = carousel.currentItemView;
這有幫助嗎?
謝謝,非常感謝。我並不期待尼克洛克伍德自己來幫助我。如果它實際上是你而不是我必須說你已經開發了一個可重用的東西。再次感謝。 :D –
那麼如果我不支持自己的東西,那麼誰會呢? ;-) –
以下任何想法http://stackoverflow.com/questions/43164687/carousel-index-are-not-in-order – hotspring