nicklockwood / iCarousel

A simple, highly customisable, data-driven 3D carousel for iOS and Mac OS
http://www.charcoaldesign.co.uk/source/cocoa#icarousel
Other
12k stars 2.58k forks source link

On a linear type iCarousel, "scrollToItemAtIndex:animated:" performs the opposite of the boolean value. #577

Open CHPraxis opened 9 years ago

CHPraxis commented 9 years ago

This function:

- (void)resetScrollPosition { [self.carousel scrollToItemAtIndex:1 animated:NO]; }

Scrolls to the position (1) with an animation. When the carousel first loads up it immediately does an animated scroll to index 1.

If I switch it to animated:YES, the scroll is not animated. The carousel immediately starts up in the correct position.

It seems animated:YES causes no animation, and animated:NO gives me an animation. I've simply put in the YES boolean to get no animation and everything is working perfect, but I figured I should let someone know.

Also: This is an iCarouselTypeLinear.

CHPraxis commented 9 years ago

Ah, the intrigue continues.

In an iCarousel with only one item and no autoscroll and no user-enabled scrolling, Animated:YES causes an iCarousel with only one item to animate the scrolls, but items with three or more items to not animate. (I turn on autoscrolling and user enabled scrolling if there are 4 or more items.)

Animated:NO reverses this.

So I can either have my small iCarousels animate and my big ones not (via animated:NO), or my big iCarousels animate and my small ones not (via animated:YES).