Growing Labels

I haven’t touched iOS in some time. I seem to remember there was a coming feature where an iOS Label could “grow” to fit the text, and then I could use the constraints to resize the parent container control.

Was that a dream or is this possible?

Are you sure you are not thinking the exact opposite… where the textsize shrinks to fit the label size.
That has been a standard iOS Label feature since forever… HOWEVER… Xojo may require a declare to expose it.


For example:
Label 1 is a title and I don’t know how long it might be. It might have to wrap.
Label 2 is the subtitle
Label 3 is the author’s name

If the title wraps I need it to grow taller so that the sub-title can be tight below it and so on.

Make sense?

What you need is to set the Title Label’s height auto-layout to “min” instead of “Equal to” (default)

Then set subtitle top to title bottom + offset
author top to subtitle bottom + offset

Jeremie, that’s the ticket. Thank you.

I’m finding it a bit difficult to determine the right initial height of the text box so that the offset for the subtitle will be the same visual gap between lines for one and two rows (so the initial state). However this is trivial.