gpt4 book ai didi

android - 横向 SW 键盘上面没有文本字段吗?

转载 作者:行者123 更新时间:2023-11-29 02:15:28 26 4
gpt4 key购买 nike

已解决:删除了编辑文本并显示了键盘使用

imgr.toggleSoftInput(0, 0);

原始问题:

您好,我正在开发具有触摸板/键盘模式的 Remote 应用程序。我的问题是 SW 键盘。当用户在 SW 键盘上按下一个键时,我需要将这个值发送到 PC。我设法在纵向模式下使用隐藏的 EditText 做到了这一点,但是当我将方向更改为横向时,SW 键盘打开时会显示白色文本字段,该文本字段覆盖键盘上方的所有空间,并显示用户编写的文本。有没有什么方法可以打开并收听没有该文本字段的横向键盘?

我打开SW键盘的代码:

InputMethodManager imgr = (InputMethodManager) getSystemService(this.INPUT_METHOD_SERVICE);
imgr.showSoftInput(edKeyListener, InputMethodManager.SHOW_FORCED);

还有 EditText xml:

<EditText
android:id="@+id/keyListener"
android:layout_width="0dp"
android:layout_height="0dp"
android:inputType="textFilter" />

最佳答案

已解决:删除了编辑文本并显示了键盘使用

imgr.toggleSoftInput(0, 0);

关于android - 横向 SW 键盘上面没有文本字段吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4317182/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com