Wednesday, October 28, 2026
HomeiOS Developmentios - correctly match a crammed Picture in its bounds on...

ios – correctly match a crammed Picture in its bounds on SwiftUI?

[ad_1]

I’ve to repair an issue with Pictures on SwiftUI. I at the moment need to fill the pictures I obtain in a sure vertical container, that are the cells of a LazyVGrid, however the issue is that the tappable space expands over the designated one.

I used the Accessibility Inspector, and I came upon that the world in extra is due the Pictures. (screenshot connected)

The code I am utilizing is one thing just like the next:

Picture(uiImage: picture.picture)
    .resizable()
    .aspectRatio(contentMode: .fill)
    .body(
        maxWidth: width,
        maxHeight: top
    )
    .clipped()

I believed that by having the frames and the clipped technique I may do away with this drawback, however that is not the case except I am utilizing some squared pictures. Any thought of what may work to repair this drawback? Thanks!

enter image description here

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments