禁用于景观软键盘输入的全屏编辑观点?全屏、景观、键盘输入、观点

由网友(与君两别生死策)分享简介:在使用软键盘的Andr​​oid设备,我想prevent出现时,以横向模式(也就是我想看到的只有软键盘本身和我的背后视图)全屏幕键盘编辑视图(如下图所示) On Android devices that use soft keyboards, I want to prevent the fullscreen keyb...

在使用软键盘的Andr​​oid设备,我想prevent出现时,以横向模式(也就是我想看到的只有软键盘本身和我的背后视图)全屏幕键盘编辑视图(如下图所示)

On Android devices that use soft keyboards, I want to prevent the fullscreen keyboard editing view (shown below) from appearing when in landscape mode (i.e. I want to see only the soft keyboard itself and my view behind it).

我想这可以使用 setExtractViewShown(假)方法来实现对 InputMethodService ,但我不能访问此默认实例,不希望实现一个自定义输入法。

I assume this can be achieved using the setExtractViewShown(false) method on InputMethodService, but I am unable to access the default instance of this and do not want to implement a custom input method.

编辑补充:视图下输入将会是不是的TextView (这是一个查看用自定义的 InputConnection 实现),因此安卓imeOptions =flagNoExtractUi将无法正常工作在这里。

Edited to add: the view to which input is going is not a TextView (it's a View with a custom InputConnection implementation), so android:imeOptions="flagNoExtractUi" won't work here.

推荐答案

我终于回答我的问题:

提取物UI(即全屏编辑模式),可以在其中输入连接的挂钩点被禁用

The extract UI (i.e. the fullscreen editing mode) can be disabled at the point at which the input connection is hooked up:

@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {

    outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI;

    // etc.
}
阅读全文

相关推荐

最新文章