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

Again with nested carousels :) .... problem adding new carousel item dynamically #863

Open Raviron opened 6 years ago

Raviron commented 6 years ago

Hello,

I'm using the nested carousels to do a data lookup on a fairly large group of data, roughly 50k entries. The first sub carousel is used to filter the content in the next ones. Some data items can be found in 2 layers of carousels, some need 5-6. I want to add and remove sub carousels to correspond with the filtering. Removing works fine, but adding just puts the new carousel on top of the main one, it does not add to the subCarousels IN the main one. From the notes:

@property (nonatomic, strong, readonly) UIView *contentView; The view containing the carousel item views. You can add subviews to this view if you want to intersperse them with the carousel items. If you want a view to appear in front or behind all of the carousel items, you should add it directly to the iCarousel view itself instead.

I get the same response when adding to either iCarousel or iCarousel.contentView:

[mainCarousel.contentView addSubview:newSubCarousel];

Also tried the insertSubview options. The all behave as if I'm adding directly to the main carousel, and appear on top. fyi I'm creating the new subViews the exact same way as in viewForItemAtIndex. Items show up fine, scrolling is fine.

Any ideas? Thanks,

Nelson