我正在试着在毛伊岛定制一个条目.主要目的是禁用边框和下划线.这是我在MauiProgram.cs文件中的当前代码:
Microsoft.Maui.Handlers.EntryHandler.Mapper.AppendToMapping(nameof(MdeEntry), (handler, view) =>
{
#if ANDROID
handler.PlatformView.SetBackgroundColor(Android.Graphics.Color.Transparent);
#elif WINDOWS
//handler.PlatformView.Background = Colors.Transparent.ToPlatform();
//handler.PlatformView.BorderThickness = new Microsoft.UI.Xaml.Thickness(0);
//handler.PlatformView.GotFocus += (s, e) =>
//{
// handler.PlatformView.Background = new Microsoft.UI.Xaml.Media.SolidColorBrush(Microsoft.UI.Colors.Transparent);
// handler.PlatformView.BorderThickness = new Microsoft.UI.Xaml.Thickness(0);
// handler.PlatformView.BorderBrush = new Microsoft.UI.Xaml.Media.SolidColorBrush(Microsoft.UI.Colors.Red);
//};
#endif
});
如你所见, comments 代码-是我试图解决我的问题,所有这些代码在Windows上都不起作用.但是,这款安卓系统的应用程序运行情况和我想的一样:
#if ANDROID
handler.PlatformView.SetBackgroundColor(Android.Graphics.Color.Transparent);
有人知道如何在Windows上禁用边框和下划线吗?