xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.63k stars 1.88k forks source link

[Bug][Android] Material DatePicker style is broken in a Frame layout #14060

Open SamuelLioult opened 3 years ago

SamuelLioult commented 3 years ago

Description

At first I had a problem with the DatePicker whose dialog color did not match the color accent specified in the Android project. After some research on Google, I found a workaround of creating a class inheriting from DatePicker and creating a renderer in which I override the CreateDatePickerDialog method. Finally, by applying a style to the key android:datePickerDialogTheme, this allows the correct color to be taken into account.

But, when I place my new control in a Frame layout, the color accent is again lost.

Steps to Reproduce

  1. See the description...
  2. Code to reproduce it

Expected Behavior

The color of the dialog may be the color accent

Actual Behavior

It's the default android color, but not the specified color accent.

Basic Information

Codelisk commented 3 years ago

Yes same issue for me. Thank you so much for the workaround. However this workaround does not work for myself