2016年

6月

05日

Xamarin.Froms  StackLayout Orientation,Children,Padding,Spacing

StackLayout レイアウト についてメモしておきます。

Vertical:縦向き

 

var Label = new Label

{
      Text = "Welcome to Orientation"
};

Content = new StackLayout
{

     Spacing = 20,
     Padding = new Thickness(10),
     Orientation = StackOrientation.Vertical,
     Children = { Label }
};

Horizontal:横向き

 

var Label = new Label
{
      Text = "Welcome to Orientation"
};

Content = new StackLayout
{

     Spacing = 20,
     Padding = new Thickness(10),
     Orientation = StackOrientation.Horizontal,
     Children = { Label }
};

Children

 

var Label = new Label

{
    Text = "Welcome to Orientation"
};

Content = new StackLayout
{

     Spacing = 20,
     Padding = new Thickness(10),
     Orientation = StackOrientation.Vertical,
     Children = { Label }
};

Padding:スペースを使用してレイアウトを囲む

 

var Label = new Label
{
    Text = "Welcome to Orientation"
};

Content = new StackLayout
{

 Spacing = 20,
   Padding = new Thickness(10),
   Orientation = StackOrientation.Horizontal,
   Children = { Label }
};

Spacing:間隔

 

var Label = new Label
{
    Text = "Welcome to Orientation"
};

Content = new StackLayout
{
   Spacing = 20,
   Padding = new Thickness(10),
   Orientation = StackOrientation.Horizontal,
   Children = { Label }
};

 

目 次