Post #1464090
2026-02-15 19:45 UTC
@lvalenta No, `frame(width: 0, height: 0)` doesn't do it because the resulting view now has size zero, not whatever the min width of the original view was, e.g.:
Color.blue
.frame(
minWidth: 10,
idealWidth: 150,
maxWidth: 300,
minHeight: 20,
idealHeight: 100,
maxHeight: 300
)
.frame(width: 0, height: 0)
.clipped()
clips the entire view.
Replies (2)
-
@dlx@mastodon.social 2026-02-15 19:46
@lvalenta You need to write a Layout that proposes `.zero` in `sizeThatFits(proposal:subviews:cache:)`
-
@lvalenta@mastodon.social 2026-02-15 19:48
@dlx of course. I’m sold, this modifier is truly missing. Am a bit sad I didn’t see it immediately.