I have a "gallery" using LazyVGrid,
struct ContentView: View {
@State private var results = [Result]()
let columns = [
GridItem(.flexible(), spacing: 1),
GridItem(.flexible(), spacing: 1),
GridItem(.flexible(), spacing: 1),
]
var body: some View {
ScrollView {
LazyVGrid(columns: columns, spacing: 1) {
ForEach(results, id: \.self) { result in
AsyncImage(url: URL(string: result.urls.small)) { image in
image
.resizable()
.aspectRatio(1, contentMode: .fit)
}
}
}
}
}
No matter what I specify as parameter for
.aspectRatio(1, contentMode: .fit)
Both "fit" and "fill" result in the images being "stretch" i.e. not respecting their aspect ratio. What is want is them to respect their aspect ratio AND fill the entire space. See the image below of how they look right now

