Search code examples
iosuser-interfaceuicollectionviewflowlayout

UICollectionViewCell side-by-side


I have UICollectionView in my custom keyboard, and it has two rows of cells with same heights, but different widths (size comes from server), direction of scroll is horizontal.

How can I show collection items side by side, without this strange centering which based on the previous cell width?

My result


Solution

  • I've achivied needed result with SKRaggyCollectionViewLayout

    enter image description here P.S. If you'll use SKRaggyCollectionViewLayout, don't forget to put self.layout.variableFrontierHeight = NO; to have same heights for all cells.