According to this case about the TimePickerDialog in spinner mode in the native android, you can pass the deprecated Theme_Holo_Light_Dialog_NoActionBar
theme to the TimePickerDialog's constructor.
And you can use the custom handler to do that. At first, please create the Custom Handler class in the /Platforms/Android:
public class MyTimePickerHandler : TimePickerHandler
{
protected override TimePickerDialog CreateTimePickerDialog(int hour, int minute)
{
TimePickerDialog timePickerDialog = new(
this.Context,
global::Android.Resource.Style.ThemeHoloLightDialogNoActionBar,
(s, e) => {
this.VirtualView.Time = new TimeOnly(e.HourOfDay, e.Minute,0).ToTimeSpan();
DateTime dateTime = DateTime.Today.Add(this.VirtualView.Time);
this.PlatformView.Text = dateTime.ToString("h:mm tt"); ;
},
this.VirtualView.Time.Hours,
this.VirtualView.Time.Minutes,
false);
return timePickerDialog;
}
}
And then use the custom handler in the mauiprogram.cs:
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
})
.ConfigureMauiHandlers(handlers =>
{
#if ANDROID
handlers.AddHandler(typeof(TimePicker), typeof(Platforms.Android.MyTimePickerHandler));
#endif
}) ;
And the result image:
