Hello,
You can use handler to remove maui Date picker underline like following code. I make a test in MainPage
, So I post the DatePickerHandler
code in the MainPage
's constructor for testing.
Please notice, handler.PlatformView.SetBackgroundDrawable(gd);
is deprecated, I use handler.PlatformView.SetBackground(gd);
, it is working.
public MainPage()
{
InitializeComponent();
Microsoft.Maui.Handlers.DatePickerHandler.Mapper.AppendToMapping("MyCustomization", (handler, view) =>
{
if (view is CustomDatePicker)
{
#if ANDROID
GradientDrawable gd = new GradientDrawable();
gd.SetColor(global::Android.Graphics.Color.Transparent);
// handler.PlatformView.SetBackgroundDrawable(gd); deprecated
handler.PlatformView.SetBackground(gd);
#endif
}
});
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.