I am trying to adjust the spacing between the primary and secondary views within a SwiftUI ArrangementView. I haven't been able to find a direct parameter or modifier (like spacing) that controls this distance on the container itself.
Is there a standard way to achieve this, or should I be looking into a workaround using padding ?
There isn't a spacing parameter on ArrangementView itself. Since the gap needs to follow whichever axis the system chooses, padding both children can add unwanted space at the outside edges too.
If you need a precise gap in both orientations, a custom ArrangementViewStyle is the cleaner option: build the split layout with an HStack(spacing:) or VStack(spacing:) based on the axis, and use the style's primary and secondary content. If you want to keep the built-in split style, the splitArrangementAxis environment value can help each child apply padding on the active axis, but you may need to balance the outer padding as well.