我同意卢卡斯的回答,使用边距是一个有效的解决方案。
也许您应该研究一下RelativeLayout?相对于整体布局或其他视图,RelativeLayout 可用于在屏幕上定位视图。
注意:由于定义约束的方式,可以在 C# 中创建比使用 XAML 指定的更复杂的布局。
一些有用的链接
这是我使用 XAML 组合在一起的示例。
<RelativeLayout>
<Label
RelativeLayout.XConstraint="{ConstraintExpression Type=Constant,Property=X, Factor=0, Constant=-30}"
RelativeLayout.YConstraint="{ConstraintExpression Type=Constant,Property=Y, Factor=0, Constant=25}"
BackgroundColor="Green"
Rotation="-90"
Text="Hello World"
TextColor="White"
/>
<Label
RelativeLayout.XConstraint="{ConstraintExpression Type=Constant,Property=X, Factor=0, Constant=-10}"
RelativeLayout.YConstraint="{ConstraintExpression Type=Constant,Property=Y, Factor=0, Constant=25}"
BackgroundColor="Blue"
Rotation="-90"
Text="Hello World"
TextColor="White"
/>
<Label
RelativeLayout.XConstraint="{ConstraintExpression Type=Constant,Property=X, Factor=0, Constant=10}"
RelativeLayout.YConstraint="{ConstraintExpression Type=Constant,Property=Y, Factor=0, Constant=25}"
BackgroundColor="Red"
Rotation="-90"
Text="Hello World"
TextColor="White"
/>
<Label
RelativeLayout.XConstraint="{ConstraintExpression Type=Constant,Property=X, Factor=0, Constant=55}"
RelativeLayout.YConstraint="{ConstraintExpression Type=Constant,Property=Y, Factor=0, Constant=18}"
BackgroundColor="Green"
Rotation="-90"
Text="123456"
TextColor="White"
/>
<Label
RelativeLayout.XConstraint="{ConstraintExpression Type=Constant,Property=X, Factor=0, Constant=75}"
RelativeLayout.YConstraint="{ConstraintExpression Type=Constant,Property=Y, Factor=0, Constant=120}"
BackgroundColor="Green"
Rotation="-180"
Text="ABC DEF GHI"
TextColor="White"
/>
<Label
RelativeLayout.XConstraint="{ConstraintExpression Type=Constant,Property=X, Factor=0, Constant=120}"
RelativeLayout.YConstraint="{ConstraintExpression Type=Constant,Property=Y, Factor=0, Constant=200}"
BackgroundColor="Green"
Rotation="45"
Text="JKL MNO PQR"
TextColor="White"
/>
<Label
RelativeLayout.XConstraint="{ConstraintExpression Type=Constant,Property=X, Factor=0, Constant=320}"
RelativeLayout.YConstraint="{ConstraintExpression Type=Constant,Property=Y, Factor=0, Constant=200}"
BackgroundColor="Green"
Rotation="-270"
Text="Aa Bb Cc Dd"
TextColor="White"
/>
<Label
RelativeLayout.XConstraint="{ConstraintExpression Type=Constant,Property=X, Factor=0, Constant=0}"
RelativeLayout.YConstraint="{ConstraintExpression Type=Constant,Property=Y, Factor=0, Constant=200}"
BackgroundColor="Blue"
Rotation="-90"
Text="Aa Bb Cc Dd"
TextColor="White"
/>
<Label
RelativeLayout.XConstraint="{ConstraintExpression Type=Constant,Property=X, Factor=0, Constant=0}"
RelativeLayout.YConstraint="{ConstraintExpression Type=Constant,Property=Y, Factor=0, Constant=200}"
BackgroundColor="Green"
Rotation="-70"
Text="Aa Bb Cc Dd"
TextColor="White"
/>
<Label
RelativeLayout.XConstraint="{ConstraintExpression Type=Constant,Property=X, Factor=0, Constant=0}"
RelativeLayout.YConstraint="{ConstraintExpression Type=Constant,Property=Y, Factor=0, Constant=200}"
BackgroundColor="Blue"
Rotation="-50"
Text="Aa Bb Cc Dd"
TextColor="White"
/>
<Label
RelativeLayout.XConstraint="{ConstraintExpression Type=Constant,Property=X, Factor=0, Constant=0}"
RelativeLayout.YConstraint="{ConstraintExpression Type=Constant,Property=Y, Factor=0, Constant=200}"
BackgroundColor="Green"
Rotation="-30"
Text="Aa Bb Cc Dd"
TextColor="White"
/>
</RelativeLayout>