Closed linusmimietz closed 1 year ago
Any fixes or workarounds yet?
@AnnieNinaJoyceV After some research, I found that I didn't need the library since loading web images is possible with standard SwiftUI. I created a gist to share the basic concept: https://gist.github.com/linusmimietz/2537046ca31940c871d92e633dc33923
Thank you @linusmimietz! I'll check it out.
I think this issue already been fixed ? The reproduce code seems works as expected:
Here's the fix:
Use the .contentShape
modifier after the .clipShape
modifier.
Ex:
WebImage(url: URL(string: "https://i.imgur.com/s3ptEuh.png")!)
.resizable()
.aspectRatio(contentMode: .fill)
.frame(maxHeight: 400)
.clipShape(RoundedRectangle(cornerRadius: 10))
.contentShape(RoundedRectangle(cornerRadius: 10)) // <-- here
Clipping the image only seems visually fine in the UI. Unfortunately elements below become unresponsive.
It was also reported here on StackOverflow: https://stackoverflow.com/questions/63300411/clipped-not-actually-clips-the-image-in-swiftui/63301282
That's my code to reproduce: