Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
142269 | Jan 24,2019 09:37 AM UTC | Jan 25,2019 10:35 AM UTC | Xamarin.Forms | 1 |
![]() |
Tags: SfPopup |
PCL:
public interface IKeyBoard
{
void HideKeyboard();
}
|
Android:
internal class CustomKeyBoardAndroid : PopupSample.IKeyBoard
{
public void HideKeyboard()
{
var context = Forms.Context;
var inputMethodManager = context.GetSystemService(Context.InputMethodService) as InputMethodManager;
if (inputMethodManager != null && context is Activity)
{
var activity = context as Activity;
var token = activity.CurrentFocus?.WindowToken;
inputMethodManager.HideSoftInputFromWindow(token, HideSoftInputFlags.None);
activity.Window.DecorView.ClearFocus();
}
}
}
|
iOS:
internal class CustomKeyBoardiOS : PopupSample.IKeyBoard
{
public void HideKeyboard()
{
UIApplication.SharedApplication.KeyWindow.EndEditing(true);
}
}
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.