contentHuggingElements
A setting that determines which type of items tightly hug their content.
Declaration
@property (nonatomic) UICollectionLayoutListContentHuggingElements contentHuggingElements;Discussion
The default value of this property is UICollectionLayoutListContentHuggingElementsSupplementaryHeader in visionOS, and UICollectionLayoutListContentHuggingElementsNone on all other platforms.
When the value of this property is UICollectionLayoutListContentHuggingElementsSupplementaryHeader, header views tightly hug their content. This means header views don’t stretch to fill the width of the collection view if its content’s intrinsic content size is less than the collection view’s width.