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

Incorrect selected index when using CoverFlow + Vertical Orientation #406

Closed jduenas closed 11 years ago

jduenas commented 11 years ago

Hi,

First of all thank you for a great product!

I'm currently having issues with a CoverFlow carousel in a vertical orientation returning the incorrect selected index.

  1. Open the Advanced iOS Demo project in the examples.
  2. Select the CoverFlow type carousel
  3. Set orientation to vertical
  4. Run the simulator and click at the center of the 2 card.

Expected Result: The 2 card scrolls to the center.

Actual Result: The 3 card scrolls to the center and the delegate returns the incorrect selectedIndex.

Any idea why this is happening?

jduenas commented 11 years ago

Hi, can someone help me with this pls? I've been trying for days to figure this out.

nicklockwood commented 11 years ago

I just tried this and it works correctly for me. Are you using the latest version?

jduenas commented 11 years ago

hmmm.. Yes, I'm using the latest version. Let me repro again and I'll get back to you. I'll try to post a video for it. Thank you for responding!

nicklockwood commented 11 years ago

Never mind - I just managed to reproduce it. Wasn't happening on iPhone but happens on iPad.

jduenas commented 11 years ago

Cool. As a work around, I was going to try setting centerToItemOnSelect = NO, make the item view a UIControl, get the index on tap, and call [carousel scrollToItemAtIndeX:]. Not sure if that will work yet.

nicklockwood commented 11 years ago

I've fixed it, will upload shortly.

nicklockwood commented 11 years ago

That fix wouldn't have worked - that's how iCarousel's centerToItemOnSelect is implemented anyway. The issue was that the depth sorting doesn't work properly in vertical mode.

jduenas commented 11 years ago

Ah I see. Thanks so much, I'll test it out as soon as it's up.