I added an image to my body in a SwiftUI application and want to have that image cover the full width of the device, but not go over it.
In body
, I return the image object:
var body: some View {
Image("page-under-construction")
}
and the image shows up, however, it's too big:
I tried setting the frame: that affects the highlighted boundaries, but the image does not resize.
In combination, I played around with .aspectRatio(contentMode:)
, which did not seem to have any effect on the layout.
How can I have the image be effectively 100% of the screen width?