我最后的尝试是这样的:
<Border Stroke="#649B33"
StrokeThickness="1"
StrokeShape="Ellipse 30, 30"
Padding="8"
Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
HorizontalOptions="Center">
<Label Text="1" FontAttributes="Bold" />
</Border>
关于
StrokeShape
属性的文档非常非常差,所以我试图猜测正确的方法,但实际上我花了太多时间并且没有任何效果。
你能告诉我如何使用
StrokeShape
属性来实现我所需要的吗?
这对我有用
<Border Stroke="#649B33"
StrokeThickness="10"
StrokeShape="Ellipse 40, 40"
Padding="8"
HorizontalOptions="Center">
<Label HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
WidthRequest="40" HeightRequest="40"
Text="1" FontAttributes="Bold" />
</Border>
我认为关键是为标签设置相同的宽度和高度值,使其成为正方形