The constraint function in the design of storyboard interface in iOS development

Source: Internet
Author: User
The first constraint Settings menu has several features in the "Editor-> pin-> ..." menu that opens the storyboard interface:
  1. Set width, height;
    The effect is not obvious.
  2. Set the horizontal and Congxiang distance between the two view;
  3. Set the view to the top and bottom of the superview spacing;
  4. Set two view equal width, equal height;
I think the third function is very good for different size adaptation.
Look at the setting example, we do two elements such as high constraints, but found that 1 has a red dot cut head, and 2 end line is orange, indicating that this constraint has not been set up, the setting is finished should be blue lines. So we click on the cut head to enter the problem list, let Xcode to help us to complete the setup, but note that the tool to complete the setup is not necessarily what we want, so it is best to just as a hint to do.
The list of prompts for Xcode is:
Click the red or yellow tips to see why.
I encountered the problem is set view to the parent view of the four-point distance, if only set up and down, prompted a problem, so also set the left and right distance. I understand that if you use the constraint function, the upper and lower left and right width should be managed by constraints, if you only use constraints to deal with the height of the problem, the program does not know the width of the processing settings. But the actual situation seems to be that I only set up the upper and lower constraints, the program also took effect, to further study.
Related Article

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.