|
I’m trying to implement a macOS window of fixed size that's only as big as it needs to be to contain an image with some multi-line text below it. I posted this question to Stack Overflow, and one of the proposed answers struck me as bonkers: using a The following code generates this layout. I’d like for the text to wrap at the width of the image, and take up as much vertical space as it needs. The resulting window should not be resizable (so I’m using I’ve tried various combinations of I’m hoping to do this without resorting to alignment guides or
|
|
It didn’t work without a geometry reader 🤷🏻 Maybe the guys can help. Or does Kavsoft have a similar thread in the video?
|
|
I tried to experiment with this for a little while, but this is the closest I have come to a solution so far. (I created
This appears to almost work, but it has a hidden problem that you can see by adjusting the The only way I can see to fix this problem so far is to explicitly set the
This allows us to set the Maybe I'll have some more time to look into this further later. |
SPONSORED Still waiting on your CI build? Speed it up ~3x with Blaze - change one line, pay less, keep your existing GitHub workflows. First 25 HWS readers to use code HACKING at checkout get 50% off the first year. Try it now for free!
Sponsor Hacking with Swift and reach the world's largest Swift community!
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.