What is SwiftUI equivalent of UIImageView aspectFill option?
When I do
Image(self.chat.thumbnailName)
.resizable()
.frame(width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.width)
.clipped()
(also tried to add .aspectRatio(contentMode: .fill) or .aspectRatio(contentMode: .fit)
I still get an ugly distorted image:

Use .scaledToFill or .scaledToFit modifiers, per needs. So in your case
Image(self.chat.thumbnailName)
.resizable()
.scaledToFill()
.frame(width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.width)
.clipped()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With