The first constraint Settings menu has several features in the "Editor-> pin-> ..." menu that opens the storyboard interface:
-
Set width, height;
The effect is not obvious.
-
Set the horizontal and Congxiang distance between the two view;
-
Set the view to the top and bottom of the superview spacing;
-
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.