No Height Constraint on Label no longer works

In a previous post, I mentioned how a missing height constraint would let the label auto expand to hold the text. With 2022r1 this doesn’t appear to work any longer. So I’m modifying the height constraint in code by counting Endoflines in the text. But guessing at the line height, and any headers or footers is wonky.

Can anyone point me to a diagram of an iOS label that shows how text is positioned in the lane?

Still works here

But the Label used to expand downwards to display all the text. Your screenshot doesn’t show that.

Are you looking at the same screenshot as we are? The IDE is on the right and the simulator is on the left.

1 Like

You’re correct, my bad.

So labels on a master split screen still work correctly, but pretty much identical labels on the detail screen don’t. That’s what got me confused.

I guess we’re going to need to see a sample project and/or some step by step instructions.

OK, so it turns out the no height constraint works with static text, but not with text modified in code. So I can count the Endoflines and adjust an existing height constraint.

I’d like to tweak the resulting height because I’m getting slightly different results depending on the content, so does anyone know of a diagram that documents how text is placed in a label? Is there some space above the text?

Have you tried setting a Min Height constraint instead of no height constraint at all?

1 Like

I thought I did, but now when I check that it works. Thanks!