kishikawakatsumi / IBPCollectionViewCompositionalLayout

Backport of UICollectionViewCompositionalLayout to earlier iOS 12
MIT License
1.55k stars 148 forks source link

LayoutGroup ContentInsets are not honored #100

Closed JobsIsMyHomeboy closed 5 years ago

JobsIsMyHomeboy commented 5 years ago

I've found that the LayoutGroup.contentInsets are not being honored.

Below is a sample layout that does not get the padding applied:

let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .estimated(201))
let item = NSCollectionLayoutItem(layoutSize: itemSize)

let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .fractionalHeight(1))
let group = NSCollectionLayoutGroup.vertical(layoutSize: groupSize, subitems: [item])
group.contentInsets = NSDirectionalEdgeInsets(top: 16, leading: 16, bottom: 16, trailing: 16)

let section = NSCollectionLayoutSection(group: group)
let layout = UICollectionViewCompositionalLayout(section: section)
kishikawakatsumi commented 5 years ago

@JobsIsMyHomeboy Thank you for reporting the issue!