UIView with auto layout does not increase height inside UIScrollView

What I'm trying to do is have a page like the following wireframe, that the height UILabel

should change dynamically based on the text:

enter image description here

I currently have it UIView

inside UIScrollView

. The problem is that I cannot resize correctly UIView

based on its content, for example when the description is long. Sample code can be downloaded from here

If not in customization for the code, here are the limitations and ways to customize it:

enter image description here

I tried using the approach mentioned in this post

0


source to share


1 answer


FINALLY found a solution for it. You need to remove the height constraint for UIScrollView

and contentView

and add a bottom constraint as shown below:

enter image description here



The sample app has been updated with this change. The sample application now works as expected.

0


source







All Articles