Hello!
I am trying to build a collection view, which sections are rendered horizontally, but sections items are rendered vertically (like a board). It looks like that:
The problem lies here in two parts of code:
Is it a bug? I am not sure what can I do in this case.
Regards!
I am trying to build a collection view, which sections are rendered horizontally, but sections items are rendered vertically (like a board). It looks like that:
Code Block swift func createCompositionalLayout() -> NSCollectionViewLayout { let itemSize = NSCollectionLayoutSize(widthDimension: .absolute(300), heightDimension: .absolute(300)) let item = NSCollectionLayoutItem(layoutSize: itemSize) let groupSize = NSCollectionLayoutSize(widthDimension: .absolute(300), heightDimension: .absolute(300)) let group = NSCollectionLayoutGroup.vertical(layoutSize: groupSize, subitem: item, count: 1) let section = NSCollectionLayoutSection(group: group) section.interGroupSpacing = 10 section.orthogonalScrollingBehavior = .continuous let layoutSectionHeaderItemSize = NSCollectionLayoutSize(widthDimension: .absolute(300), heightDimension: .absolute(200)) let layoutSectionHeaderItem = NSCollectionLayoutBoundarySupplementaryItem(layoutSize: layoutSectionHeaderItemSize, elementKind: NSCollectionView.elementKindSectionHeader, alignment: .top) section.boundarySupplementaryItems = [layoutSectionHeaderItem] let configuration = NSCollectionViewCompositionalLayoutConfiguration() configuration.scrollDirection = .horizontal configuration.interSectionSpacing = 10 let layout = NSCollectionViewCompositionalLayout(section: section, configuration: configuration) return layout }
The problem lies here in two parts of code:
scrollDirection (line 18)
Header's code (lines 12-15)
Is it a bug? I am not sure what can I do in this case.
Regards!