这是一个由others...And开发的名为I'm MT3的游戏,我想实现这个功能,自定义输入布局,其中包含一个EditText和两个按钮。

首先,我使用InputMethodManager显示InputMethodManager,下面是我的代码片段:
InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
imm.toggleSoftInput(0, InputMethodManager.HIDE_IMPLICIT_ONLY);发布于 2016-07-12 15:12:08
最后,我自己解决了这个问题。@Polarberes0106的答案是对的,但软键盘仍然是全屏模式。这是禁用全屏的答案。Disabling the fullscreen editing view for soft keyboard input in landscape?
这是我的解决方案:
如果您通过代码创建EditText,只需添加以下行:
//EditText et;
et.setImeOptions(et.getImeOptions()| EditorInfo.IME_FLAG_NO_EXTRACT_UI);或者,如果您通过xml创建EditText:
只需将属性android:imeOptions="flagNoExtractUi“添加到XML文件中的每个EditText。
https://stackoverflow.com/questions/38240863
复制相似问题