I have a VStack with fixed width and height.
I want the Image to fill the entire width and height of the VStack container, no matter if the image is landscape or portrait oriented.
VStack {
Image(.document1)
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: 300, height: 200)
}
.frame(width: 300, height: 200)
.background(.red)
This produces the following result, with red letterboxing from the VStack background color. How can I make sure the Image always scales to fill the entire container?
: