Instance Method

layoutPriority(_:)

Sets the priority by which a parent layout should apportion space to this child.

Declaration

func layoutPriority(_ value: Double) -> some View

Discussion

The default priority is 0. In a group of sibling views, raising a view’s layout priority encourages that view to shrink later when the group is shrunk and stretch sooner when the group is stretched.

A parent layout should offer the child(ren) with the highest layout priority all the space offered to the parent minus the minimum space required for all its lower-priority children, and so on for each lower priority value.