I have a UILabel (among other controls) stored in a UIScrollView. I want to dynamically populate a UILabel so that it automatically increases its height to fit its contents. I'm just wondering what the best thing is about resizing the UILabel, as well as ensuring that its parent UIScrollView also expands its scrollable area.
I tried setting UILabel # ofLines to 0, which, as I read, should automatically extend UILabel to match its contents, but I was not very lucky. Regarding recalculating the scrollable area of UIScrollViews, I assume this is a case of calculating the height of its children after filling in the UILabel.
source
share