我有一个collectionView,它在tableView的单元格中。collectionView有多个部分。如果一个部分只有一个单元格,那么该单元格会居中显示。如何将该单元格对齐到左边?
collectionView使用以下flowLayout
:
let flowLayout = UICollectionViewFlowLayout()
flowLayout.scrollDirection = .vertical
flowLayout.sectionInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
flowLayout.minimumInteritemSpacing = 0
flowLayout.minimumLineSpacing = 0
flowLayout.estimatedItemSize = UICollectionViewFlowLayout.automaticSize
collectionView.setCollectionViewLayout(flowLayout, animated: true)