Contents

Layout fundamentals

Arrange views inside built-in layout containers like stacks and grids.

Overview

Use layout containers to arrange the elements of your user interface. Stacks and grids update and adjust the positions of the subviews they contain in response to changes in content or interface dimensions. You can nest layout containers inside other layout containers to any depth to achieve complex layout effects.

[Image]

To fine-tune the position, alignment, and other elements of a layout that you build with layout container views, see Layout adjustments. To define custom layout containers, see Custom layout. For design guidance, see Layout in the Human Interface Guidelines.

Topics

Choosing a layout

Statically arranging views in one dimension

Dynamically arranging views in one dimension

Statically arranging views in two dimensions

Dynamically arranging views in two dimensions

Layering views

Automatically choosing the layout that fits

Separators

See Also

View layout