Microsoft.Maui.Handlers.EntryHandler.Mapper.AppendToMapping("Borderless", (handler, view) =>
{
if (view is ComponentEntry)
{
#if ANDROID
handler.PlatformView.Background = null;
handler.PlatformView.SetBackgroundColor(Android.Graphics.Color.Transparent);
handler.PlatformView.FocusChange += (object sender, Android.Views.View.FocusChangeEventArgs e) => {
if (!e.HasFocus)
{
Android.Views.InputMethods.InputMethodManager imm = (Android.Views.InputMethods.InputMethodManager)global::Android.App.Application.Context.GetSystemService(global::Android.Content.Context.InputMethodService);
if (imm != null)
{
imm.HideSoftInputFromWindow(handler.PlatformView.WindowToken, 0);
}
}
};
#endif
#if IOS
//handler.PlatformView.BackgroundColor = UIKit.UIColor.Clear;
//handler.PlatformView.Layer.BorderWidth = 0;
//handler.PlatformView.BorderStyle = UIKit.UITextBorderStyle.None;
handler.PlatformView.ShouldReturn = (textField) => {
textField.ResignFirstResponder();
return true;
};
handler.PlatformView.EditingDidEnd += (sender, e) => {
((UIKit.UITextField)sender).ResignFirstResponder();
};
#endif
}
});
I wanna hide device keyboard when entry is unfocus. Where is wrong in this part which is in program.cs? Especially ios part. Please help me. I don’t know ios platform settings.