I have an image (or filled rectangle, or anything) placed inside a NavigationLink, but it doesn't get its full width, instead it's the width minus the corner radius. Here's my simplified code:
ScrollView(.vertical, showsIndicators: false) {
LazyVGrid(columns: columns, spacing: 20) {
ForEach(children, id: \.self) { childTopic in
NavigationLink(value: childTopic) {
Image(childTopic.previewImage)
.resizable()
.scaledToFill()
.frame(maxWidth: 300, maxHeight: 150, alignment: .top)
.clipShape(RoundedRectangle(cornerRadius: 15.0, style: .circular))
}
.buttonBorderShape(.roundedRectangle(radius: 15.0))
.padding(20.0)
}
}
.padding()
}
The screenshot shows what each list items look like. Is it possible to make the image fill the NavigationLink?
PS: I played around with .buttonStyle(.plain) on the NavigationLink, but on visionOS it still gets an overlay when the user looks at it - which is a good thing, but larger than the image.