You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to inset my content in my CollectionViewController subclass, and I'm not sure how to do it.
First I tried updating the collectionView.layoutMargins, but that did nothing to how the cells are laid out. It seems like epoxy ignores the layoutMargins.
Second, I tried modifying my UICollectionViewCompositionalLayout and modified the group content insets as such: group.contentInsets = .init(top: 20, leading: 20, bottom: 0, trailing: 20)
This seemed to work for the leading and trailing sides, but the top had no effect on pushing the first cell down.
Any insight on how to lower my top cell without adding a margin to the first cell itself?
The text was updated successfully, but these errors were encountered:
Hi Dylan! I would recommend using the additionalSafeAreaInsets.top of the CollectionViewController to adjust the insets of the CollectionView within. This is how the bar installers work under the hood as well. It should allow you to inset the first cell.
teradyl
changed the title
CollectionViewController doesn't abide by layoutMargins or top NSCollectionLayoutGroup.contentInsets or
CollectionViewController doesn't abide by layoutMargins or top NSCollectionLayoutGroup.contentInsets
Feb 24, 2021
I'm trying to inset my content in my CollectionViewController subclass, and I'm not sure how to do it.
First I tried updating the
collectionView.layoutMargins
, but that did nothing to how the cells are laid out. It seems like epoxy ignores the layoutMargins.Second, I tried modifying my
UICollectionViewCompositionalLayout
and modified the group content insets as such:group.contentInsets = .init(top: 20, leading: 20, bottom: 0, trailing: 20)
This seemed to work for the
leading
andtrailing
sides, but thetop
had no effect on pushing the first cell down.Any insight on how to lower my top cell without adding a margin to the first cell itself?
The text was updated successfully, but these errors were encountered: