Infinite Carousel Banner realization of the principle of

 

 

 

As shown above, we need to add the number of the original image before and after the two placeholders FIG, respectively, the first and the last one in FIG. FIG at initialization time, to locate the second image position (i.e.: actual display The first picture).

When the scrolling stops, determine:

1, if the current position is the first position (i.e.: placeholder last picture), the offset is set to scrollview penultimate position (i.e.: FIG actual last one)

2, if the current position is the last position (namely: a first placeholder images), the offset is set to a second position scrollview positive (i.e.: FIG first actual)

In conjunction with the map view, will clearly know which principles of the

Of course, to achieve the general number of carousels in accordance with the above principle is sufficient, if it is the number of the picture very much, we have to consider memory problems, in fact, we can specify the total number of images on the current scrollview, for example, is fixed at 5 months, and then dynamically calculated at a before and after picture, which should show a short, understand the principle, if extended, how to innovate, and that it is your own thing

 

Guess you like

Origin www.cnblogs.com/zbblog/p/12053666.html