Xamarin:水平堆栈布局问题中的垂直位置

时间:2020-09-19 12:09:27

标签: xaml xamarin.forms stacklayout

两个标签应该在底行,但是第二个标签在底行有一些空间。它们之间的唯一区别是Fontsize。

如何管理两个标签都位于相同的垂直位置?

<StackLayout
    Orientation="Horizontal"
    Spacing="1">
    <Label 
        Text="{Binding First}"
        FontSize="{Binding FirstFontSize}"
        LineBreakMode="NoWrap"
        VerticalOptions="End"/>
    <Label 
        Text="{Binding Second}"
        FontSize="{Binding SecondFontSize}"
        LineBreakMode="NoWrap"
        VerticalOptions="End"/>
</StackLayout>

enter image description here

1 个答案:

答案 0 :(得分:1)

您已经很好地注意到,这就是在不同字体大小下呈现文本的方式。对齐正确。如果您喜欢其他内容,则只能手动添加填充。

相关问题