UICollectionView estimatedItemSize - last cell is not aligned

前端 未结 8 1743
春和景丽
春和景丽 2020-12-29 02:41

I want to make a usual horizontalScrolling flowLayout UICollectionView with estimatedItemSize and preferredLayoutAttributesFittingAttributes in cell. But there is something

相关标签:
8条回答
  • 2020-12-29 03:03

    You are setting estimatedItemSize in the init of view itself.

    You need to set it in some controller.

    Also,

    If all of your cells are the same height, use the itemSize property, instead of this property, to specify the cell size instead.

    Documentation: estimatedItemSize

    0 讨论(0)
  • 2020-12-29 03:15

    there is a simple method to resolve this. You can add number of prototype cells to check the cell at required position. Once you find the issue at last cell . Check the cell insets in Inspector window.

    0 讨论(0)
提交回复
热议问题