-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Title colour on Android Picker, initially appears grey. #16737
Comments
Sorry, I made mistake with the entry for "Last version that worked well" |
Just seen another mistake that i have made when submitting this issue. Again I must apologise. This is my first attempt to submit a bug report and I'm still learning the ropes! |
OK the hex values that i'm submitting are being automatically changed by GitHub so the "00" prefix is being removed. |
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. |
I have found an alternative fix for this issue by implementing the following handler customization in the MainPage constructor.: public MainPage() #if ANDROID } Of course, you could implement this handler customization in other places as well. |
+1, just came across this myself. Thanks for bringing up this issue. |
Verified this issue with Visual Studio Enterprise 17.9.0 Preview 2. Can repro on android platform with sample project. |
Used this handler as a workaround for annoying issues with TitleColor being inconsistent on Android PickerHandler.Mapper.AppendToMapping("RealTitleColor", (handler, view) =>
{
Color titleColor = view.TitleColor;
if (titleColor is not null)
{
handler.PlatformView.SetHintTextColor(titleColor.ToPlatform());
}
}); |
I would also add this additional observation: forced dark/light mode is not respected when the TextColor and the TitleColor are the same. For example, if the system is in dark mode but the app is forced to light mode via System Dark Mode, App Light Mode, TextColor and TitleColor are the sameSystem Dark Mode, App Light Mode, TextColor and TitleColor are differentRepro project: https://github.com/RedZone908/AndroidForcedLightModePickerRepro Didn't seem to make sense to report this as a different bug since it seems like it's probably an extension of the same one. |
Hi all, I encountered this same issue while running my .NET MAUI app. While testing the app, I thought this issue might differ from android version to version and I found:
From my understanding, this seems to be related to Android rendering rather than a problem with MAUI itself. While I’m not a .NET MAUI expert, it appears Android 10 handles rendering differently in this case. Here's a visual comparison while the app was running in Android 10: For now, I just used two different colors with one character changed in HEX, as in the above first image. |
Description
I think there is a possible bug with Android Picker control where the Picker title colour, initially appears grey when the Picker.TitleColor property is set to same colour value as Picker.TextColor property.
The following screenshot shows the issue:
Two Picker controls were added to the MainPage.xaml of the default MAUI project that is created when selecting a new MAUI project:
The 1st Picker control has the TitleColor property set to the same color value as the TextColor property, which in this case, is Green.
When the program is run for the Android platform, the 1st Picker control's Title is grey and not green as you would expect.
The 2nd Picker control has the TitleColor property set to a different color value than the TextColor property, which in this case, is Green for the TitleColor property and Red for the TextColor property.
When the program is run for the Android platform, the 2nd Picker control's Title is green as you would expect.
Steps to Reproduce
Link to public reproduction project repository
https://github.com/AllieMash/MauiPickerColorBugDemo
Version with bug
7.0.92
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
7.0.86
Affected platforms
Android, I was not able test on other platforms
Affected platform versions
Android 7.0 API 24 and above
Did you find any workaround?
If you need both TitleColor and TextColor to visually appear the same colour, you could change the value of one of these colour properties, by a very small amount so the visual difference in colour is hardly perceptible.
For example you could set the TitleColor and TextColor properties to the following values so the Picker title will appear green as required:
TitleColor="#8000" TextColor="#8001"
However this can become a hassle in some projects where you have a colour already pre-set for a specific purpose (i.e. Themes) since you my need to define and extra color specifically for use with the Picker control on the Android platform.
It would be nice to have this issue corrected.
Relevant log output
The text was updated successfully, but these errors were encountered: