UICollectionView layout of last cell

风流意气都作罢 提交于 2019-12-05 01:19:26

I came across a similar issue with the last few cells in the collection view having an unsightly offset. In my case it was a result of not honoring the section insets with respect to the item sizes.

Try setting the sectionInset of the flowLayout to 0:

flowLayout.sectionInset = UIEdgeInsetsZero;

If this doesn't work you might need to enforce a minimumInterItemSpacing as the flow layout seems to bugger this up on the last few cells:

flowLayout.minimumInteritemSpacing = 10.f;//or any reasonable number
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!