1, in the automatic layout is estimated the most complex should be a sliding view, it is not only depends on its lock in the parent view of the length and width of the possession, also depends on its contentsize is its actual sliding range.
How do we constrain scroll view, as follows
We create a sliding view with a distance of 40 distance left 20 size x for 280 y to 300
And then we'll constrain it so that he shows it in the parent view as follows
、
Distance up view 20 then make sure its size is 300 width to 280, but in this case, its sliding range is simply not deterministic, how to determine its sliding range, as follows
We give him an auxiliary view called content and then to constrain this view, his long heel width determines the sliding range of the sliding view
As follows
We determined that the distance on the left 0 width is 1000 height of 300. Actually, this is the sliding range of the sliding view.
And then the sliding range is out.
How iOS uses aotolyout to constrain scroll View and TableView