Quantcast
Channel: User Liyun Zhang - MSFT - Stack Overflow
Viewing all articles
Browse latest Browse all 446

Answer by Liyun Zhang - MSFT for Change Color of Entry Underline or Remove this Color

$
0
0

For remove the underline on the android, you can add the following code into the MauiProgram.cs:

Microsoft.Maui.Handlers.EntryHandler.Mapper.AppendToMapping(nameof(Entry), (handler, view) =>        {#if ANDROID            handler.PlatformView.BackgroundTintList = ColorStateList.ValueOf(Android.Graphics.Color.Transparent);#endif        });

And on the windows platform, you can put the following code into the /Platforms/Windows/App.xaml:

<maui:MauiWinUIApplication.Resources><Thickness x:Key="TextControlBorderThemeThickness">0</Thickness><Thickness x:Key="TextControlBorderThemeThicknessFocused">0</Thickness></maui:MauiWinUIApplication.Resources>

And there is no underline on the ios.

update 1:

Before:

enter image description here

After:

enter image description here


Viewing all articles
Browse latest Browse all 446

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>