32 lines
1.1 KiB
C#
32 lines
1.1 KiB
C#
namespace MauiApp.Helpers;
|
|
|
|
public static class EntryHelper
|
|
{
|
|
public static void RemoveBorders()
|
|
{
|
|
Microsoft.Maui.Handlers.EntryHandler.Mapper.AppendToMapping("Borderless", (handler, view) =>
|
|
{
|
|
#if ANDROID
|
|
handler.PlatformView.Background = null;
|
|
handler.PlatformView.SetBackgroundColor(Android.Graphics.Color.Transparent);
|
|
#elif IOS
|
|
handler.PlatformView.BackgroundColor = UIKit.UIColor.Clear;
|
|
handler.PlatformView.Layer.BorderWidth = 0;
|
|
handler.PlatformView.BorderStyle = UIKit.UITextBorderStyle.None;
|
|
#endif
|
|
});
|
|
|
|
Microsoft.Maui.Handlers.PickerHandler.Mapper.AppendToMapping("Borderless", (handler, view) =>
|
|
{
|
|
#if ANDROID
|
|
handler.PlatformView.Background = null;
|
|
handler.PlatformView.SetBackgroundColor(Android.Graphics.Color.Transparent);
|
|
#elif IOS
|
|
handler.PlatformView.BackgroundColor = UIKit.UIColor.Clear;
|
|
handler.PlatformView.Layer.BorderWidth = 0;
|
|
handler.PlatformView.BorderStyle = UIKit.UITextBorderStyle.None;
|
|
#endif
|
|
});
|
|
}
|
|
}
|