我有一个需要显示默认软键盘的 Activity (强制进入 protrait 模式)。所以我想我会在 Activity 启动时将焦点设置到编辑文本上……到目前为止一切顺利。
两个问题
- 软键盘不得 可对此 Activity 解雇
- 软键盘需要 从底部升高 50 像素 屏幕
寻求帮助解决这两个问题。谢谢。
最佳答案
解决#1
private void hideSoftKeyboard()
{
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(mAutoCompleteTextView.getApplicationWindowToken(), 0);
}
private void showSoftKeyboard()
{
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,InputMethodManager.HIDE_IMPLICIT_ONLY);
}
#2 没有解决方案
关于android - 强制显示默认的 Android 软键盘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6066282/