Net maui Net 8 how to create Borderless Entry, Editor and Picker handlers

Sami 966 Reputation points
2023-11-06T01:40:28.9366667+00:00

Net maui Net 8 how to create Borderless Entry, Editor and Picker handlers (all platforms) samples.. can you help thanks..

Developer technologies | .NET | .NET MAUI
{count} votes

Accepted answer
  1. Anonymous
    2023-11-08T05:36:08.15+00:00

    Hello,

    yes remove lines.. by handler for net 8

    Ok, let us focus on this remove underlines for Entry, Editor and Picker in .NET 8 for Android platform,

    I found new solution to fix this issue. You can use handler.PlatformView.BackgroundTintList = Android.Content.Res.ColorStateList.ValueOf(Colors.Transparent.ToAndroid()); to set the bordless for entry, editor and picker. You need to set it once in the app.xaml.cs, it will work for this application.

    You can refer to the following code.

    #if ANDROID
    
    
    using Microsoft.Maui.Controls.Compatibility.Platform.Android;
                
    #endif
    
    
    namespace MauiNET8Bordless
    {
        public partial class App : Application
        {
            public App()
            {
                InitializeComponent();
    
    
               Microsoft.Maui.Handlers.EntryHandler.Mapper.AppendToMapping("MyCustomization", (handler, view) =>
                {
    #if ANDROID
                    handler.PlatformView.BackgroundTintList = Android.Content.Res.ColorStateList.ValueOf(Colors.Transparent.ToAndroid());
    
    
    #endif
                });
    
    
               Microsoft.Maui.Handlers.EditorHandler.Mapper.AppendToMapping("MyCustomization", (handler, view) =>
                {
    #if ANDROID
                    handler.PlatformView.BackgroundTintList = Android.Content.Res.ColorStateList.ValueOf(Colors.Transparent.ToAndroid());
    
    
    #endif
                });
    
    
               Microsoft.Maui.Handlers.PickerHandler.Mapper.AppendToMapping("MyCustomization", (handler, view) =>
                {
    #if ANDROID
                    handler.PlatformView.BackgroundTintList = Android.Content.Res.ColorStateList.ValueOf(Colors.Transparent.ToAndroid());
    
    
    #endif
                });
    
    
               MainPage = new AppShell();
            }
    

    Best Regards,

    Leon Lu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.