Xamarin.Forms Guides | Samples

Xamarin.Forms.StackLayout.Spacing Property

Gets or sets a value which indicates the amount of space between each child element.

Syntax

public Double Spacing { get; set; }

Value

A value in device pixels which indicates the amount of space between each element. The default value is 6.0.

Remarks

Setting this value triggers a layout cycle if the StackLayout is already in a parent Layout.

The following example sets the Spacing on construction of a StackLayout.

C# Example

var stackLayout = new StackLayout {
  Spacing = 10
};

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