splitArrangementLayoutRatio(_:)
Sets the preferred size ratio for an arrangement view in a split style. Use this modifier when you want to customize the size of the view compared to its other views in the split layout.
Declaration
nonisolated func splitArrangementLayoutRatio(_ ratio: CGFloat?) -> some View
Parameters
- ratio:
The ratio the view uses for its preferred size.
Discussion
The view with the highest layoutPriority will be sized first using its ratio. When a ratio is used on a view that would be greater than the remaining size of the arrangement view container, the remaining size will be used. When a ratio of a view would result in the views of the container not filling its total size, the highest priority view will fill the remaining size of the container.
ArrangementView {
ConversationView()
.splitArrangementLayoutRatio(0.3)
} secondary: {
PhotosView()
}
.arrangementViewStyle(.split.axes(.horizontal))See Also
Dynamically arranging a primary and secondary view
ArrangementViewarrangementViewStyle(_:)ArrangementViewStyleoverlayArrangementEdge(_:)splitArrangementFixedLayoutSize(horizontal:vertical:)splitArrangementLayoutRatio(minHorizontal:idealHorizontal:maxHorizontal:minVertical:idealVertical:maxVertical:)splitArrangementLayoutSize(minWidth:idealWidth:maxWidth:minHeight:idealHeight:maxHeight:)