Могу ли я использовать UICollectionViewCompositionalLayout
для создания макета в стиле Pinterest / Waterflow?
закрытие было с
func buildLayout() -> UICollectionViewCompositionalLayout {
// cells
let itemSize = NSCollectionLayoutSize(widthDimension: .estimated(10), heightDimension: .estimated(10))
let item = NSCollectionLayoutItem(layoutSize: itemSize)
let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .estimated(10))
let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitem: item, count: 3)
group.interItemSpacing = .flexible(10)
let section = NSCollectionLayoutSection(group: group)
section.interGroupSpacing = 10
let configuration = UICollectionViewCompositionalLayoutConfiguration()
configuration.scrollDirection = .vertical
return UICollectionViewCompositionalLayout(section: section, configuration: configuration)
}
, но я не могу понять, как убрать пространство под каждым элементом