Reputation: 11
I have UIScrollView with UIView inside (lets name it contentView). Frame size of contentView changes during runtime and that's the main problem! If I had static controls it would be easy to set up scrolling, just pin contentView to scrollView and add 2 constraints equalWidth/equalHeight of view (with Low priority), but it doesn't work for me. So, can anyone help?
Upvotes: 1
Views: 953
Reputation: 820
It's a pretty easy to fix, all you need to do is to give the "contentView" constrains to the scrollView edges with 0 margin...
If the contentView will be bigger then the UIScrollView frame the scrollView will be scrollable..
All you need to do is to make sure that the last Subview in content view have bottom constraint to contentView.
If I'm not clear enough please tell me.
Upvotes: 4