Picker Title displays above the control on Windows
See original GitHub issueDescription
When running on Windows, the Picker
displays the Title
property above the control. According to the documentation, and the behaviour on Android, I expect it to be treated as a placeholder when no item is selected.
Documentation snippet:
Windows:
Android:
Steps to Reproduce
- Create new MAUI app.
- Add a
Picker
toMainPage.xaml
as below (direct copy from Microsoft’s sample code)
<Picker x:Name="picker"
Title="Select a monkey">
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Baboon</x:String>
<x:String>Capuchin Monkey</x:String>
<x:String>Blue Monkey</x:String>
<x:String>Squirrel Monkey</x:String>
<x:String>Golden Lion Tamarin</x:String>
<x:String>Howler Monkey</x:String>
<x:String>Japanese Macaque</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
- Run on
Windows Machine
Version with bug
Release Candidate 2 (current)
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
Windows 10 (21H2 | 19044.1645)
Did you find any workaround?
No
Relevant log output
N/A
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:13 (4 by maintainers)
Top Results From Across the Web
Picker - .NET MAUI
The .NET MAUI Picker displays a short list of items, from which the user can select an item.
Read more >Setting a Picker's ItemsSource Property - Xamarin
The Picker view is a control for selecting a text item from a list of data. This article explains how to populate a...
Read more >Setting colours (yes I'm Canadian) does not work on Picker
The inverse problem occurs in dark mode, where setting the TitleColor specifically to Black is ignored and the title will display in its...
Read more >Picker.Title Property (Microsoft.Maui.Controls)
Gets or sets the title for the Picker. This is a bindable property.
Read more >Display WinRT UI objects that depend on CoreWindow
Certain pickers, popups, dialogs, and other Windows Runtime (WinRT) objects depend on a CoreWindow; typically to display a user-interface ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Setting
pick.Title = null;
after line 15 in @MitchBomcanhao 's code snippet seems to do the trick (to remove the header from the native view).For completeness, I’m pasting the snippet here again:
@mkomel Thanks for the snippet, it works great. I think it’s worth noting that the
TitleColor
property will not be applied to thePlaceholderText,
but it can be with the adjustment below.