Post

Replies

Boosts

Views

Activity

Is it possible to tweak collection view cell's layoutMarginsGuide when using compositional layout?
For UITableViewCells and UICollectionViewListCells, their contentView.layoutMarginsGuide respect the colletionView's layoutMarginsGuide automatically, which can be 16 or 20 points horizontally. This is the expected behavior. But for regular UICollectionViewCells with a regular compositional layout, their contentView.layoutMarginsGuide are defaulted to 8 points. I don't see where I can hook into and change the layout margins of the cells . I've looked into contentInset property and contentInsetReference property of section and item when constructing a compositional layout, but with no luck, their intentions are to change the width of the cells themselves.
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
798
Sep ’21
Is it possible to tweak collection view cell's layoutMarginsGuide when using compositional layout?
For UITableViewCells and UICollectionViewListCells, their contentView.layoutMarginsGuide respect the colletionView's layoutMarginsGuide automatically, which can be 16 or 20 points horizontally. This is the expected behavior. But for regular UICollectionViewCells with a regular compositional layout, their contentView.layoutMarginsGuide are defaulted to 8 points. I don't see where I can hook into and change the layout margins of the cells . I've looked into contentInset property and contentInsetReference property of section and item when constructing a compositional layout, but with no luck, their intentions are to change the width of the cells themselves.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
1
Boosts
0
Views
798
Activity
Sep ’21