SwiftUI VStack - make the background fill the entire screen in landscape

Solution 1:

The problem seems to be because of scaledToFit, which tries to preserve the image's aspect ratio and so doesn't make the background extend all the way.

To fix, just make the background stretch as much as it can with .frame(maxWidth: .infinity). Make sure to put this modifier before background so that the color respects the new layout.

.padding(.top, 30)
.frame(maxWidth: .infinity) /// here!
.background(Color.black)