Giter Club home page Giter Club logo

Comments (2)

nicklockwood avatar nicklockwood commented on September 25, 2024

Hi Zoe,

iCarousel has a delegate method:

- (CATransform3D)carousel:(iCarousel *)carousel transformForItemView:(UIView *)view withOffset:(CGFloat)offset;

This lets you supply your own 3D transform to apply to each view to get whatever effect you want, without needing to rewrite any of the library. The Example project demonstrates doing this to create the "custom" carousel, which is not in the standard library.

To create a cylindrical carousel like the one you describe, just copy the cylindrical carousel code from inside the library, stick it in the delegate method above and then tweak it to get the effect you want. It should be fairly simple.

If you have hundreds of items, you will also want to implement:

- (NSUInteger)numberOfVisibleItemsInCarousel:(iCarousel *)carousel;

To restrict the number of views that the carousel displays simultaneously to a manageable number like 10 or 20.

If you are really struggling with it, you can hire me on a contract basis to implement the carousel as you've described - it shouldn't take more than an hour or so.

Nick

On 17 Aug 2011, at 20:37, ZoeSummers wrote:

Hi

Amazing library.

I have a problem where I need to use the cylinder type carousel, with quite a wide spacing, but with a dataset of at least 200 images, maybe going into the thousands.

I need to use the cylinder because of all of them it has the most affordance for swiping for non iOS friendly users.

However, I don't need the ones at the rear of the carousel to show all of them - therefore making the diameter of the cylinder larger than it is with just the sample demo size of 21, but I do need that an item gets to the very back, it doesn't start to come back around until it really should.

Not sure if I'm being clear enough, but lets say the cylinder holds 21 visible items the one at the back left is 21 and the one to it's immediate right is number 1 - i.e. it's wrapping and we're probably looking at 10 or 11 at the 'front'.

However, with a large data set of 1000, if I'm looking at 500 at the front, the rear left will be 511 and the rear right will be 489, so with the next swipe to the left, the rear left will be 512 and the right right will be 488... but regardless of the size of the data set, the diameter of the 'cylinder' is fixed.

Is this possible without a huge re-write of the icarousel.m code? Or have I missed the forrest for the trees and it's must more simple and elegant?

Thanks so much for this library (and your others) and I hope you find the time to help with this question.

Regards

Zoe

Reply to this email directly or view it on GitHub:
https://github.com/demosthenese/iCarousel/issues/34

from icarousel.

ZoeSummers avatar ZoeSummers commented on September 25, 2024

Thank you for your prompt response...

That's great info and I'll take a look at that.

If you want to contact me directly about your final suggestion, please can you email me at zoe AT me DOT com

Thanks Nick.

from icarousel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.