.NET MAUI 안드로이드 Entry, Picker 언더라인 삭제

        EntryHandler.Mapper.ModifyMapping("NoUnderline", (handler, entry, action) =>
        {
            handler.PlatformView.BackgroundTintList = ColorStateList.ValueOf(Colors.Transparent.ToPlatform());
        });
        PickerHandler.Mapper.ModifyMapping("NoUnderline", (handler, picker, action) =>
        {
            handler.PlatformView.BackgroundTintList = ColorStateList.ValueOf(Colors.Transparent.ToPlatform());
        });

MauiProgram.cs

using Android.Content.Res;
using Microsoft.Extensions.Logging;
using Microsoft.Maui.Handlers;
using Microsoft.Maui.Platform;

namespace MauiApp4;

public static class MauiProgram
{
	public static MauiApp CreateMauiApp()
	{
        var builder = MauiApp.CreateBuilder();
		builder
			.UseMauiApp<App>()
			.ConfigureFonts(fonts =>
			{
				fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
				fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
			});

        EntryHandler.Mapper.ModifyMapping("NoUnderline", (handler, entry, action) =>
        {
            handler.PlatformView.BackgroundTintList = ColorStateList.ValueOf(Colors.Transparent.ToPlatform());
        });
        PickerHandler.Mapper.ModifyMapping("NoUnderline", (handler, picker, action) =>
        {
            handler.PlatformView.BackgroundTintList = ColorStateList.ValueOf(Colors.Transparent.ToPlatform());
        });

        return builder.Build();
	}
}

삭제 전

1

삭제 후

2

3개의 좋아요