Previously, frame was set manually, or autoresizing was used,
However, with the release of iPhone 6 and 6 plus, autolayout is almost the best adaptation solution, with too many sizes of Linear Regression
Previously developed autolayout was disabled in the panel, so we can't do it now ~
First, let's see how to use autolayout in Ib. First, drag two uiviews and set the background color,
Select a view and click the following button.
A clear view of the function, relative to the top, bottom, left and right, so that when switching between the screen or different sizes, the view will automatically adapt
What is the maximum width and height?
After the conditions are set, click the Add constraint button to add constraints to the view. In this case, the view automatically adjusts its position and size.
There should be not many constraints given using autolayout,
What are not many? If you specify that the upper and lower sides of the view are 100 different from those of the parent view, you do not need to add other constraints to the view. If you limit the width of the view at the same time, there is a limit on redundancy.
Or you have added only the limit on width and height without adding other restrictions. In this case, the view only knows its width and height, but does not know its position. In this case, the constraints are missing.
If your restrictions are missing or redundant, IB will prompt you.
Click the red dot button indicated by the arrow in the middle to give suggestions for deleting or adding constraints (jump)
Click "little red dot" to display the restricted operation interface. add or delete constraints ~, However, you 'd better check it by yourself. The running of the province is not what you want.
The red box of is the added constraint. If you want to delete the constraint, click the delete key. If you want to modify the constraint, you can click it in the attribute panel on the right, set the background color and title with uibutton.
Autolayout ~