Search code examples
xamlxamarin.formsstacklayout

Xamarin: vertical position in horizontal stacklayout issue


The 2 labels should be at the bottom line, but the second label has some space to the bottom line. The only difference between them is the Fontsize.

How can I manage that both labels are at the same vertical position?

<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


Solution

  • As you have well noted, this is how the text is rendered at different font sizes. The alignment is correct. You can only manually add padding if you prefer something different.