Logo

dev-resources.site

for different kinds of informations.

.NET MAUI BorderLessEntry for all platforms

Published at
3/21/2024
Categories
maui
xamarinforms
xamarin
Author
vamsi_reddy_397438ed17335
Categories
3 categories in total
maui
open
xamarinforms
open
xamarin
open
Author
25 person written this
vamsi_reddy_397438ed17335
open
.NET MAUI BorderLessEntry for all platforms

Image description

First Create a Class with BorderlessEntry and add the below code

public class BorderlessEntry: Entry

{
}

Next in the MauiProgram.cs file add the below line of code

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");
});
    Microsoft.Maui.Handlers.EntryHandler.Mapper.AppendToMapping("Borderless",(handler,view) =&gt;
    {
        if(view is BorderlessEntry)
        {
Enter fullscreen mode Exit fullscreen mode
Enter fullscreen mode Exit fullscreen mode




if ANDROID


           handler.PlatformView.Background=null;
handler.PlatformView.SetBackgroundColor(Android.Graphics.Color.Transparent);
Enter fullscreen mode Exit fullscreen mode




elif IOS || MACCATALYST


                handler.PlatformView.BackgroundColor = UIKit.UIColor.Clear;
handler.PlatformView.Layer.BorderWidth= 0;
handler.PlatformView.BorderStyle = UIKit.UITextBorderStyle.None;
Enter fullscreen mode Exit fullscreen mode




elif WINDOWS


                 handler.PlatformView.BorderThickness= new Microsoft.UI.Xaml.Thickness(0);
Enter fullscreen mode Exit fullscreen mode




endif


            }
    });
    return builder.Build();
}
Enter fullscreen mode Exit fullscreen mode
Enter fullscreen mode Exit fullscreen mode




final in Solution Explore open Platforms/Windows/App. Xaml and add the below line of code

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

xamarin Article's
30 articles in total
Favicon
Linux vs macOS vs Microsoft Windows: Which is Best for Software Development?
Favicon
𝗚𝗲𝘁 𝗗𝗲𝘃𝗘𝘅𝗽𝗿𝗲𝘀𝘀 .𝗡𝗘𝗧 𝗠𝗔𝗨𝗜 𝗖𝗼𝗻𝘁𝗿𝗼𝗹𝘀 𝗳𝗼𝗿 𝗙𝗿𝗲𝗲 𝗕𝗲𝗳𝗼𝗿𝗲 𝗗𝗲𝗰𝗲𝗺𝗯𝗲𝗿 𝟯𝟭, 𝟮𝟬𝟮𝟰!
Favicon
15 Best Chrome Extensions for Developers: Boost Your Productivity and Workflow
Favicon
Top 10 iOS Automation Testing Tools for 2025 (with Key Features)
Favicon
Modern Startup & Login Screens for .NET MAUI + MVVM
Favicon
UI components for MAUI apps
Favicon
How to check the MySQL version on Windows, so easy that even a five-year-old can learn it
Favicon
Building Multi-Page Applications with Xamarin Forms - Tips and Tricks
Favicon
Mobile Development
Favicon
.NET MAUI BorderLessEntry for all platforms
Favicon
Understanding Cross-Platform Development with Xamarin
Favicon
Navigating Cross-Platform Development: A Comparative Analysis of React Native, Xamarin, Flutter, and Electron
Favicon
Xamarin vs. React Native: Which Cross-Platform App Development Framework to Choose
Favicon
Is Xamarin Dead?
Favicon
Crafting Native Mobile Apps Across Platforms with .NET: Unleashing the Power of Xamarin
Favicon
iOS Tips Xamarin Forms - Get Safe Area Height
Favicon
Exploring the Most Popular Cross Platform App Development Frameworks
Favicon
iOS Tips - This app cannot be installed because its integrity could not be verified
Favicon
Sneak Peek at 2023 Volume 3: Xamarin
Favicon
My journey in mobile development - From C# to Swift
Favicon
بهترین آموزش .NET MAUI فارسی
Favicon
Xamarin/C# app
Favicon
Flutter Vs Xamarin- Which Is The Best Cross-Platform Development Framework?
Favicon
Welcome to the New Era of App Development: Introducing Avalonia v11
Favicon
🔒 Introducing Serial Log and Metro Log: Simplifying Your Logging Experience In .NET MAUI! 📝🚇
Favicon
How to Build Mobile Check Capture App with Xamarin.Forms and Dynamsoft Document SDK
Favicon
Sneak Peek at 2023 Volume 2: Xamarin
Favicon
Incredible App Themes for Xamarin.Forms
Favicon
Learn how to Integrate Push Notifications in .NET MAUI
Favicon
App link c# Xamarin

Featured ones: