private void HideSoftKeyboard(object sender, EventArgs args) { if (CurrentFocus != null) { var inputMethodManager = (InputMethodManager)GetSystemService(InputMethodService); inputMethodManager.HideSoftInputFromWindow(CurrentFocus.WindowToken, 0); CurrentFocus.ClearFocus(); } }
public void HideSoftKeyboard() { if (CurrentFocus != null) { var inputMethodManager = (InputMethodManager)GetSystemService(InputMethodService); inputMethodManager.HideSoftInputFromWindow(CurrentFocus.WindowToken, 0); CurrentFocus.ClearFocus(); } }
public void HideSoftInput() { if (CurrentFocus != null) { CurrentFocus.ClearFocus(); using (var inputMethodManager = (InputMethodManager)GetSystemService(InputMethodService)) inputMethodManager.HideSoftInputFromWindow(CurrentFocus.WindowToken, 0); } }
public Keycode OnKeyPressed(Keycode keycode) { if (CurrentFocus.GetType() == typeof(Android.Support.V7.Widget.AppCompatEditText)) { CurrentFocus.DispatchKeyEvent(new KeyEvent(KeyEventActions.Down, keycode)); CurrentFocus.DispatchKeyEvent(new KeyEvent(KeyEventActions.Up, keycode)); if (keycode == Keycode.Enter) { CurrentFocus.ClearFocus(); } } return(keycode); }
private void Drawer_DrawerOpened(object sender, DrawerLayout.DrawerOpenedEventArgs e) { if (CurrentFocus == null) { return; } InputMethodManager inputMethodManager = (InputMethodManager)this.GetSystemService(Android.Content.Context.InputMethodService); inputMethodManager.HideSoftInputFromWindow(CurrentFocus.WindowToken, 0); CurrentFocus.ClearFocus(); }