Display three equal-width views via AutoLayout

Source: Internet
Author: User

Demand----------"requires AutoLayout to make three views on all devices always equal width

1 "We know that fixing a control on a window requires a minimum of four constraints, so that every control needs to be constrained to

Idea---can be adjusted to the same width based on the fixed control adaptive

2 "Take lable as an example

1/Three lable on storyboard and set color to differentiate

2/Below we will constrain three lable

High

From the parent view above

From the bottom of the parent view

From the left side of the parent view

And then you have to keep them wide, before the purple view

And then the Red view.

The first one's bound to end up like this.

We were at once constrained by the other two

Set the two boundaries, adjust the spacing, and then, uh, just get three equal-width controls.

Display three equal-width views via AutoLayout

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.