iOS - UICollectionView spacing still there when set to 0 - How to set with no spacing between cells

前端 未结 6 1440
南旧
南旧 2020-12-16 12:03

I have a simple UICollectionView which I have set with 0 spacing in InterfaceBuilder but when I populate the collection view with cells there is still some spacing. Is there

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-16 12:29

    In order to actually have zero space, the number of cells and their width should be divisible by the collection view's own width, for example if you have 5 cells at a time with a width of 100px, then your collection view should have 500px in width, if it's larger then it will force a space between cells.

提交回复
热议问题