Post

Replies

Boosts

Views

Activity

Reply to How to replicate UIImageView's `scaleAspectFill` for Images inside a custom Layout?
@DTS Engineer – Thanks for the response. I had considered those options but weren't ideal. I found a slightly better approach, though. As the expected behaviour is to fill all the available space with the image, we can just use Color (which, when used as a view, expands to fill all the space it is given) and the Image as an overlay. This will effectively make the Image expand to use all the available space whilst clipping it to its bounds. Color.clear .overlay { Image("adriana-wide") .resizable() .scaledToFill() } Not quite the solution I was expecting, but does the trick.
Jul ’24