How to use stack view object libraries in Xcode 7

I recently installed Xcode 7 beta strong> and found something new in the object library, like

A horizontal view of the stack and a view of the vertical stack .

When I put some controls in it, the stackview seems volatile to fit the size of the controls. When I introduce more controls, the stack seems to automatically adjust in terms of the stack. Or adjustment horizontally or vertically?

Is it derived from any other mobile platform

+7
ios xcode swift uistackview
source share
1 answer

The main advantage of using UIStackView is the use of automatic layout for the placement and size of hosted UIViews . Therefore, you do not need to worry about positioning UIViews in a UIStackView . For a horizontal stack, this means that the leading edge of the first view is attached to the leading edge of the stacks, and the last adjusted view of the leading edge is attached to the leading edge of the stacks, you can try inserting two or more controls into the horizontal stack view as they are aligned horizontally wrt together.

The UIStackView class provides a simplified interface for laying out a set of views in a column or row. Stack views allow you to use the power of automatic layout by creating user interfaces that can dynamically adapt to device orientation, screen size, and any changes in available space. The stack view controls the layout of all views in the builtSubviews property. These views are located along the axis of the points of the stack, depending on their order in an array of arrays. The exact layout varies depending on the stack, the viewing axis, distribution, alignment, spacing and other properties.

How to use

Here is a detailed tutorial from raywenderlich:

http://www.raywenderlich.com/114552/uistackview-tutorial-introducing-stack-views

For more information see https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIStackView_Class_Reference/index.html

+2
source share

All Articles