I am trying to solve a problem that i've looked around for but can't figure out. I have a UILabel
control inside of a UIScrollView
control. I have set the height of the label to the height of the scrollview
in which it is contained, now I need to determine the correct height (dynamically) of text that will fill the label. So whenever the scrollView
height is, the text height inside of the label will match and the width will expand to prevent the text from truncating (like the image below).
I've tried things like sizeToFit
, constrainedSize
, but i couldn't get it to work properly, any direction on how to achieve something like this?