Layout.Padding 属性

定义

获取或设置布局的内部填充。

public:
 property Microsoft::Maui::Thickness Padding { Microsoft::Maui::Thickness get(); void set(Microsoft::Maui::Thickness value); };
public Microsoft.Maui.Thickness Padding { get; set; }
member this.Padding : Microsoft.Maui.Thickness with get, set
Public Property Padding As Thickness

属性值

布局的粗细值。 默认值为粗细,所有值都设置为 0。

注解

填充是布局边界与其子级应排列到的边界区域之间的间距。

下面的示例演示如何设置布局的填充以嵌入其子级。

var stackLayout = new StackLayout {
  Padding = new Thickness (10, 10, 10, 20),
  Children = {
    new Label {Text = "Hello"},
    new Label {Text = "World"}
  }
}

适用于