Knowledge Point One:
1. Layout thinking
Traditional layout ideas, a view where there is how big, it is clear that its coordinate position and width of the fixed, usually with CGRect and cgpoint these two models is enough, and it must be very listening to your words, write how much, it is absolutely how much But AutoLayout's ideas have changed, or improved, to encompass the traditional frame layout, which, in addition to telling the view's coordinates and width, provides a relative concept, such as:
1) View relative to the left side of the screen view 5 points, 10 points on the right, 15 points above, 20 points below, if the screen's length and width ratio has changed (for example, from 3.5 inch 320:480 to 4-inch 320:568, or from the horizontal screen to the vertical screen), The view will still stretch with the scale of the screen, still remain away from the screen view 5 points to the left, 10 points on the right, 15 points above, 20 points below;
2) between View1 and View2 10 points apart, when the screen size changes or rotation, they can still change their size or position changes to ensure that they are 10 points apart;
So, the first step in using AutoLayout is that you need to think about the way it's going up and down relative to Superview or brotherview, changing the way you think about your layout.
2, the use of AutoLayout existing problems:
Using AutoLayout may often get the look you don't want to see, and you won't be able to change frame.
Knowledge Point Two,
AutoLayout can do all the work that the original autoresizing mask can do, and also be able to perform tasks that were previously impossible, including:
AutoLayout can specify the relative position of any two view without needing two view in the immediate view hierarchy like Autoresizing mask.
AutoLayout does not have to specify a constraint on an equality relationship, it can specify a non-equality constraint (greater than or less than, etc.), and the layout that autoresizing mask can make can only be of equal condition.
The AutoLayout can specify the precedence of the constraint, and the calculation of the frame takes precedence over the condition that satisfies the high priority.
Knowledge Point Three:
Blue Auxiliary Line: Indicates that constraints is sufficient to indicate the location of the view.
OK Constraints
Orange Auxiliary Line: Indicates that the constraints is not complete to indicate the location of the view
Constraints Not OK
Numbers on orange guides: sometimes positive, sometimes negative. When you set or change the constraints, you may constraints the location of the view you placed on the interface is different. The system will be constraints, the interface prompts you orange auxiliary line, the number on the line is the location of this view and the constraints gap. You can then select the update frame in "Resolve auto Layout issues" so that the view will automatically move to the place indicated by constraints, or you can update constraints, where the view is not changed. Constraints to a value consistent with the view position on the interface
For a view that does not provide a constraints, the system automatically adds constraints, which are not visible on the interface constraints. This is the biggest improvement of XCODE5 and XCODE4 in the AutoLayout technology upgrade! XCODE4 is a system-imposed constraints that often interferes with developers because the constraints you impose is often not what you want. XCODE5 's improvements make it easy for developers to design and implement them according to their own intentions: first, you don't have to modify the system-imposed constraints, and then there are some view locations you don't need to add constraints, so you can ignore them. Note: This automatic to view plus constraints only applies to you a constraints is not added, if you add X-direction, y-direction also need to be added manually.
Constraints buttons
Summary: Links and recommendations
1. Start the automatic layout tutorial in iOS 7
Original text && translation one:
Http://www.raywenderlich.com/50317/beginning-auto-layout-tutorial-in-ios-7-part-1
Http://www.cocoachina.com/industry/20131203/7462.html
Original text && Translation II:
Http://www.raywenderlich.com/50319/beginning-auto-layout-tutorial-in-ios-7-part-2
Http://www.cnblogs.com/zer0Black/p/3977288.html
2. "AutoLayout and the VFL experience sharing"
This article contains a simpler description of the use of the VFL and common AutoLayout techniques. Enough for everyone to use.
3. Introduction to AutoLayout (Automatic layout)
This article contains a streamlined approach to AutoLayout code operations.
4. IOS Developer Guide
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/Introduction/ Introduction.html
Carefully read the above links and recommendations, I believe you will have a new understanding of AutoLayout, the use of AutoLayout should not be a problem.
AutoLayout Study Notes