Xamarin.Forms Guides | Samples

Xamarin.Forms.StackLayout Constructor

Initializes a new instance of the StackLayout class.

Syntax

public StackLayout ()

Remarks

The following example shows the initialization of a new StackLayout and setting its orientation and children.

C# Example

var stackLayout = new StackLayout {
  Orientation = StackOrientation.Horizontal,
  Children = {
    firstChild,
    secondChild,
    thirdChild
  }
};

Requirements

Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions: 1.0.0.0, 1.1.0.0, 1.2.0.0, 1.3.0.0, 1.3.3.0, 1.4.0.0, 1.5.0.0, 2.0.0.0