I am using a UILabel
in a UITableViewCell
to display a title. Normally the text is not too long and therefore the font size can be large. Notice how the text fills the height of theUILabel
like normal.
However, when there is a larger title, I want the UILabel
height to reduce to accommodate the smaller font size and not leave a blank gap in its place. Currently, my configuration produces this effect.
I am using constraints in my storyboard and have deliberately not set a fixed height constraint. Here are the relevant constraints added:
I may have made a rookie error in my configuration as I can't remember this effect happening before, but it is giving me real headaches (and a bad looking UI).