Android 切换软键盘 以及关闭

来源:互联网 发布:it infra 编辑:程序博客网 时间:2024/06/06 15:57

Android 切换软键盘 以及关闭

private void toggleInput(Context context){      InputMethodManager inputMethodManager =      (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);      inputMethodManager.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);  }  切换软键盘private void hideInput(Context context,View view){      InputMethodManager inputMethodManager =      (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);      inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0);  } 隐藏软键盘
0 0
原创粉丝点击