I’ve encountered with strange displaying of Picker
control (MAUI 8.0) on Android when I trying to arrange line by VerticalOptions="Start"
:
At a glance is seems like this control has predefined Padding
attribute (top and bottom, and spacing between brackets around), but unfortunately it doesn’t ever have it.
Sample code:
<code> <HorizontalStackLayout Padding="0" Spacing="0">
<Label Text="start ("
FontSize="12"
VerticalOptions="Start"/>
<Picker Title="Item 2"
FontSize="12"
Margin="0"
VerticalOptions="Start">
<Picker.Items>
<x:String>Item 1</x:String>
<x:String>Item 2</x:String>
</Picker.Items>
</Picker>
<Label Text=") end"
FontSize="12"
VerticalOptions="Start"/>
</HorizontalStackLayout>
</code>
<code> <HorizontalStackLayout Padding="0" Spacing="0">
<Label Text="start ("
FontSize="12"
VerticalOptions="Start"/>
<Picker Title="Item 2"
FontSize="12"
Margin="0"
VerticalOptions="Start">
<Picker.Items>
<x:String>Item 1</x:String>
<x:String>Item 2</x:String>
</Picker.Items>
</Picker>
<Label Text=") end"
FontSize="12"
VerticalOptions="Start"/>
</HorizontalStackLayout>
</code>
<HorizontalStackLayout Padding="0" Spacing="0">
<Label Text="start ("
FontSize="12"
VerticalOptions="Start"/>
<Picker Title="Item 2"
FontSize="12"
Margin="0"
VerticalOptions="Start">
<Picker.Items>
<x:String>Item 1</x:String>
<x:String>Item 2</x:String>
</Picker.Items>
</Picker>
<Label Text=") end"
FontSize="12"
VerticalOptions="Start"/>
</HorizontalStackLayout>
I know that it is possible to replace it by the toolkit’s Popup, but it is a workaround, not a solution. I suspect that I’m missing something very easy and obvious…