How iOS uses aotolyout to constrain scroll View and TableView

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.