Image Modifiers...

.border

.clipped

Image(decorative: "xxx")

Source: HWS,

.frame

// .frame(maxWidth: .infinity, maxHeight: .infinity)
.aspectRatio(1, contentMode: .fit)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.aspectRatio(1, contentMode: .fit)

...

.frame(maxWidth: .infinity) // give as much as space it needs

ImagePaint()

Repeats the image on the given space.

.resizable()

Stretches the image.

.scaledToFill()

.scaledToFit()

Last updated