Here is how two boxes with text are rendering in SwiftUI, but I want them to both be full-width:
Here is my code:
VStack(spacing: 20){
//Help ---
VStack(alignment: .leading, spacing:10){
Text("Help").h2()
Text("Please view our online user guide before contacting us since we answer most questions there.")
.lineLimit(nil) //Make the text wrap
.prefsText()
Button("Online Help"){
openURL(URL(string: "https://avid.pro/help")!)
}.foregroundColor(Color(accentColor))
.buttonStyle(PlainButtonStyle())
.prefsLink()
}.unoBoxRoundPad()
.frame(maxWidth: .infinity)
//Support ---
VStack(alignment: .leading, spacing:10){
Text("Support").h2()
Text("Email us if you need to submit a bug or get specialized help. It may take us a few days to get back to you.")
.lineLimit(nil) //Make the text wrap
.prefsText()
Button("Email Us"){
openURL(URL(string: "mailto:help@avid.pro")!)
}.foregroundColor(Color(accentColor))
.buttonStyle(PlainButtonStyle())
.prefsLink()
}.unoBoxRoundPad()
.frame(maxWidth: .infinity)
}.background(Color.yellow) //For testing
I can't for the life of me figure out why they aren't the same width. .unoBoxRoundPad() is a view modifier that adds these shared styles:
.padding(20)
.background(Color("UnoDark"))
.cornerRadius(7)
If I put .frame(maxWidth: .infinity) on the Text() instead of on the containing VStack, it seems to get a little closer, but then it disregards the containing view's padding():
Any ideas on what I'm doing wrong?

