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

前端 未结 6 1420
南旧
南旧 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:19

    The documentation for [UICollectionViewFlowLayout minimumInteritemSpacing] mentions:

    This spacing is used to compute how many items can fit in a single line, but after the number of items is determined, the actual spacing may possibly be adjusted upward.

    You may need to implement a custom layout to do this. The documentation can be found here, and an example here.

提交回复
热议问题