
For more information, see Margin and Padding. The value of the Margin property represents the distance between an element and its adjacent elements. The equivalent C# code is: public class VerticalStackLayoutPageCS : ContentPage By default, there are six device-independent units of space between the child views: This example creates a vertical StackLayout containing Label and BoxView objects.
Height and width layer list stack how to#
The following XAML shows how to create a vertically oriented StackLayout that contains different child views: To obtain the best possible layout performance, follow the guidelines at Optimize layout performance. The Children property is the ContentProperty of the Layout class, and therefore does not need to be explicitly set from XAML. The StackLayout class derives from the Layout class, which defines a Children property of type IList. These properties are backed by BindableProperty objects, which means that the properties can be targets of data bindings and styled. The default value of this property is six device-independent units. Spacing, of type double, indicates the amount of space between each child view.The default value of this property is Vertical. Orientation, of type StackOrientation, represents the direction in which child views are positioned.


The StackLayout class defines the following properties: In addition, a StackLayout can be used as a parent layout that contains other child layouts. By default, a StackLayout is oriented vertically. A StackLayout organizes child views in a one-dimensional stack, either horizontally or vertically.
