Reprint please specify transfer from here: http://blog.csdn.net/xietao3/article/details/41549959
1, the first is the picture of the top four key (leading left, trailing right, top, bottom)
Raise a chestnut, the left ARROW key, use this function need to select the key is red solid to play a corresponding role, and the input box indicates that the control x coordinate relative to a control's leading, trailing, top, bottom (four positions selected) coordinate distance, This relative control and which position of the control can be selected, by clicking the input box to the right of the lower triangle to select the control, the position of the control in the Properties panel selection, the constant input box is a specific numerical size, it is worth mentioning that this function is not only for the superior view, Controls on the same layer can also use this method to maintain a constant distance between 2 controls.
: The graph content indicates that the relative control is named 1 for a button with a relative distance of 80
2, Width, height
These two functions are more straightforward, for example, the width of control A in SB is 50, the constraint width is entered into the number 100, and the actual width of the control is 100 when it is started.
3, Equal Widths, Equal Heights
These two constraints are useful to control the width or height of control A as the width or height of control B varies.
: The width of the control 1 and the width of the control View1 are bound to One-fourth of the width of the View1.
4, combined with the above constraints, to apply, to the left for the simulator post-compilation effect, the right is SB panel.
There are 2 types of constraints, one of which is 1, space to and 3, Equal widths/heights
Controls 1, 2, 3, and 4 add equal widths constraints, respectively, to the background View1, with a width of 1/4 View1.
Control 1 leading and viewleading interval 0,1 trailing and control 2leading interval 0, and so on until 4 trailing and View1 interval of trailing is 0.
You can see that control 5 is stretched, 2 constraints are used here, 5 leading and view1leading intervals 10,5 trailing and View1 intervals of 10, resulting in 5 being stretched.
5, Aspect ratio this function and equal series A bit similar, are dynamic control wide height, different is this function relative control can be itself
: The height of the control 6 and the width of its own 1:2 scale, after the simulator runs, the width is twice times higher.
6, Align This is mainly used for all kinds of alignment
Leading, trailing, top, bottom, center, Hor, Ver are left-aligned, right-aligned, bottom-aligned, horizontal-center-aligned, vertical-centered, and can be offset by constant.
Baseline is strange, for the control of the bottom of the text alignment, with the actual effect a little way out, it seems to only play the role of compressed text box height.
Horizontal alignment, the alignment position can be centerx, leading, trailing.
The left side of the figure is the emulator, the right side is the SB panel, which uses the horizontal alignment, the position is CenterX
Auto Layout usage profiling (1)