Today touch the page layout of things, Liu Guobin teacher in detail in the form of graphic programming and code will be solved again. Code and Stroyboard feeling are more troublesome, and logical thinking requirements are relatively high.
The editor menu has a resolve Auto Layout issues submenu. From this menu, select Update Constraints. In my case, this would tell interface Builder to make the constraint 64 points, like this:
Well, the t-bars is blue again, the layout is effective. In document outline, you can see that the horizontal space constraint no longer has a standard interval:
So far you've tried horizontal space and vertical space constraints. There is also a "center" constraint. Drag a New button object to the center of the bottom of the canvas, depending on the position to which the wire is intact:
To keep the button centered in the horizontal direction to the parent view, you need to add a center X alignment constraint. Select Align\horizontal Center in Container from the editor menu. This adds a very long orange segment:
The line is orange because you only specify the x axis of the button, but the y-axis does not specify a constraint. Use the Editor\pin menu to add a vertical space constraint between the button and the bottom of the view. Looks like this:
If you don't know the reason, this is the bottom Space to superview option. The Vertical space constraint keeps the button away from the bottom of the view (once again using the standard interval).
Run the program and rotate it to the horizontal screen mode. Even in landscape mode, the button remains at the center of the bottom of the screen:
That's what you mean---this button should always be centered at the bottom. Notice that you don't have to tell the Interface Builder button what the coordinates are, unless you want to pin it on the view.
Classification:Uncategorized | comments: 0 | Views:1 | favorites | Give him a reward .
Lan Yi iOS page layout autolayou