Hiding the Underline in MAUI Entry Control

Learn how to completely remove the default underline from the Entry control on Android in .NET MAUI by modifying its handler for a cleaner UI.

  1. In page.xaml file

    1
    
    <Entry x:Name="entry" Placeholder="This is an entry" />
    
  2. In page.cs file

    1
    2
    3
    4
    5
    6
    7
    8
    
    protected override void OnHandlerChanged()
    {
        base.OnHandlerChanged();
    #if ANDROID
        var edittext = entry.Handler.PlatformView as Android.Widget.EditText;
        edittext.Background = null;
    #endif
    }
    
Built with Hugo
Theme Stack designed by Jimmy