0
votes

So I've followed all the best practices with respect to having a scrollable content view that works with autolayout (first have one direct subview of UIScrollView, add all the pin constraints, etc), especially when you have a UITextView (i.e. disable scrollingEnabled on the text view)

for example here, or just googling UIScrollView and Autolayout you'll find a lot of tutorials that rehash the same thing.

I've done all this, but am noticing that the scrollView is calculating a contentSize that does not match the contentView's height. I have no idea why this is:

enter image description here

I expect moderators to point out other questions. I looked around and nothing really matched what I'm seeing...

1
You say it doesn't match, so... What is the contentView's height? And, is your contentView's bottom anchor constrained to the bottom anchor of the scroll view, with a constant of Zero?DonMag
ha! very bizarre. Somehow in the storyboard the constant was set to 680horseshoe7

1 Answers

0
votes

For completeness, it was DonMag's comment that solved it. Unknowingly, the constant was not set to 0, which explains why the contentSize.height WAS 680pt larger than the content.