【问题标题】:showing softkeyboard in android on landscape orientation在android中横向显示软键盘
【发布时间】:2015-04-09 17:34:36
【问题描述】:
EditText textView = (EditText ) findViewById(R.id.editText1);
textView.requestFocus();
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(textView, InputMethodManager.SHOW_IMPLICIT);

我使用此代码自动打开软键盘。 它在正常情况下工作正常,但是当我将其更改为横向时android:screenOrientation="landscape" 在清单中,它停止工作。 有什么问题?

【问题讨论】:

    标签: android keyboard show-hide


    【解决方案1】:

    你需要用力表现出来。

    InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,InputMethodManager.HIDE_IMPLICIT_ONLY);
    imm.showSoftInput(textView, InputMethodManager.SHOW_FORCED);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-27
      • 2013-12-16
      • 2020-04-08
      • 2013-05-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多