GithubHelp home page GithubHelp logo

Comments (5)

gerchicov-bp avatar gerchicov-bp commented on May 28, 2024 1

@chx632996066 Hello, sorry but I can't due to my employer's rules. The only hint I can say is iCarousel uses a formula which involves integer index param but you need to pass into this formula a float/double param. So anyways you need to edit this formula in library

from icarousel.

nicklockwood avatar nicklockwood commented on May 28, 2024

iCarousel doesn't support this at the moment. There are a few options to solve this:

  1. Use the placeholder view functionality to fill in the gaps at the end (this solution was provided to prevent unsightly gaps at the ends of carousels)

  2. In the didScroll delegate method, if the user scrolls to an index less than 1 or greater than numberOfItems - 2, automatically scroll the view back so that it snaps to index 1 or numberOfItems - 2. That way there will never be a gap at the ends, except temporarily while the user is dragging the carousel.

  3. Modify the library to allow the min/max start/end scrolling index to be specified. This would be similar to option 2, but by modifying the library you could make the stop/bounce effect at each end a bit nicer.

from icarousel.

gerchicov-bp avatar gerchicov-bp commented on May 28, 2024

1 - doesn't work if you need to avoid all the empty space (and even give less space to item sequence than it requires)
2 - looks awful because an user may scroll as if nothing is changed and only at the end of touch event the scroll jumps to the correct position
3 - works! but we need to rewrite your library (not inheritance) because you provide the same methods for start/end index for both scrolling and one item actions. If we don't rewrite your library then we will have incorrect distances in the top and bottom of carousel or vice versa we couldn't operate with some indexes (for example remove them)

from icarousel.

chx632996066 avatar chx632996066 commented on May 28, 2024

@gerchicov-bp Hi,can you show me the code how u rewrite the library?thank you very much!

from icarousel.

skliarovartem avatar skliarovartem commented on May 28, 2024

Did you find solution? Thanks!

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.