Adjusting Spacing in ArrangementView

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 ?

Thanks for the question, interesting you want that spacing but you can use standard SwiftUI you can create a padding inside each view to the edge:

ArrangementView {
    PrimaryView()
        .padding(.trailing, 16) // Creates the gap

Is that what you want instead of letting ArrangementView do the work for you?

I would suggest to play with it inside the view and add padding or changing the frame with and height:

ArrangementView {
        Text("Primary")
            .frame(maxWidth: .infinity, maxHeight: .infinity)
            .background(.blue.opacity(0.2), in: .rect(cornerRadius: 12))
    } secondary: {
        Text("Secondary")
            .frame(maxWidth: .infinity, maxHeight: .infinity)
            .background(.green.opacity(0.2), in: .rect(cornerRadius: 12))
    }

You can play with the arrangementViewStyle as well to find something that works for you:

ArrangementView {
    PlayerControls()
} secondary: {
    VideoPlayer()
}
.arrangementViewStyle(.overlay) 

https://developer.apple.com/documentation/swiftui/arrangementview

Hope this helps, I would suggest to make sure the ArrangementViews are padded well in all positions and views as the device can display those differently depending on the position.

Albert  WWDR