I've got a custom view that is full of child views, and those child views are constrained to the top/left/bottom/right of the parent view. I then put that custom view inside of a scroll view. When I look at the view, the entire thing is drawn properly, so my constraints all seem to be correct for position and sizing.
However, in the view controller that the scroll view is in, when I call systemLayoutSizeFitting against that custom view, it's giving me a width, but the height says 0. That makes is so I can't scroll vertically.
I'm not sure how to debug this to figure out what's going on. The fact that is says 0 for height makes me think that somehow it can't follow from top to bottom, but if it couldn't, then all the child views would be in the right locations with the right heights.
I understand better what you are doing. But difficult to analyze without seeing the whole thing. So, let us guess.
It is always more difficult to debug when there are a lot of objects.
May be the child views in custom view are creating constraints that lead to set the height to zero.
One way to test would be to keep (for the test) only one subview in custom view ;
set top and bottom constraints let say to 20 and the child view height to 40.
And see what is the result.
What sometimes happen in these situations is that you have to change the priority of some constraints (900 vs 1000) so that autolayout manages it correctly.
You don't have any message in the log about autolayout ?