iOS CollectionView Pager does not display preview of cells on next page

26 Views Asked by At

I am using a collectionview to create a pager. The pager shows 4 cells and is scrolling by another 4 (the number does not matter).

The first cell of the 2nd page should be visible at the edge, as a preview, so users can see they can scroll.

However nothing is displayed, the cells are only rendered the moment I start dragging.

Is there a way to achieve this? In Android pagers you can set a value, how many pages are pre-rendered. This would be an ideal solution.

Thank you

Tobias

1

There are 1 best solutions below

0
Duncan C On

Collection views are very flexible, and support just about any layout you want.

I believe what you want is a custom UICollectionViewFlowLayout. Check out this sample project on Github: https://github.com/MaatheusGois/carousel-flow-layout.git

That implements a "carousel" layout that looks like this:

CarouselFlowLayout GIF

That should give you a starting point for implementing your desired layout.