I have laid out all the containerViews and subviews in my scrollView in the storyboard, each with a top, bottom, leading and trailing pin, and also a height and a vertical spacing constraint. After I load my info from the server and populate the info into my UILabels, I make all my UILabel (with numberOfLines=0) call sizeToFit. I then reset all my container view's height accordingly and finally resetting also the height of my scrollView and its contentView.
However, when I run the program, the scrollView did not expand vertically as expected. I made an NSLog querying the frame.size.height of all my UILabels and they are correctly expanded. But not the scrollView and the containerViews for the UILabels.
Do I have to call some methods to ask the app to re-layout the views and subviews according to the new height constraints? And what is that magic method?
Need help!
scrollView
? – CaptJak