Justify last line of UICollectionView

前端 未结 2 1897
渐次进展
渐次进展 2020-12-03 18:08

As far as I can see, UICollectionViewFlowLayout justifies all the lines of a section except the last one. So for example, if there aren\'t enough items to fill

2条回答
  •  隐瞒了意图╮
    2020-12-03 18:27

    This is not really possible, unfortunately. It's just not designed that way, unfortunately.

    One thing I can think of that might work though is to add an extra item into the data source, returned at the end, which has a cell that is 0 pixels tall and the width of the collection view. That will force the last row to be a single row with just that one item on it and then all rows above it will be justified.

提交回复
热议问题