Open Jake-Derrick opened 1 year ago
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.
Does anyone have a workaround till the fix hopefully makes it in a few decades?
Also having this issue. Only works if the ItemSource is empty and it's been focused and then unfocused. Is this fixed in .NET 8?
Still a issue in latest 8.0.7 MAUI. Placeholder color is not grey but normal black text
It looks like Picker.TextColor somehow overrides Picker.TitleColor, so the Picker.TitleColor has wrong color.
Here is a workaround:
Microsoft.Maui.Handlers.PickerHandler.Mapper.AppendToMapping("PickerMapper", (handler, view) => { if (view is Picker) { handler.PlatformView.TextColor = UIColor.PlaceholderText;
var item = ((Picker)view).SelectedItem;
if (item != null)
{
handler.PlatformView.TextColor = UIColor.Black;
}
else
{
handler.PlatformView.TextColor = UIColor.PlaceholderText;
}
((Picker)view).SelectedIndexChanged += (s, e) =>
{
var item = ((Picker)view).SelectedItem;
if (item != null)
{
handler.PlatformView.TextColor = UIColor.Black;
}
else
{
handler.PlatformView.TextColor = UIColor.PlaceholderText;
}
};
}
});
Description
TextColor
instead ofTitleColor
.ItemSource
to null or an emptry string will display the Title correctly.From the Maui Picker Doc
Actual (black text)
Setting the
TitleColor
to Red andTextColor
to Blue the Picker Title is displayed in BlueSteps to Reproduce
See the description/repo
Link to public reproduction project repository
https://github.com/Jake-Derrick/PickerTitleIssue
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 16
Did you find any workaround?
No response
Relevant log output
No response