Search code examples
uicollectionviewuicollectionviewcellflowlayoutmosaic

How to 'fit' the cells of UICollectionView FlowLayout?


My aim is to create an UICollectionView with different cell sizes and all cells "fit in". There should be no empty place around the cells.

Here is an image of my Demo Application: enter image description here

The sizes of t he Cells are quarter, quaver and semiquaver (1/4, 1/8 and 1/16). So how can i realize that? How can i delete the white space around the cells to push them all together to get a look like mosaic?

thanks for your help,
brush51


Solution

  • Take a look at RFQuiltLayout https://github.com/bryceredd/RFQuiltLayout it is exactly what you need.

    RFQuiltLayout fit