禁用于景观软键盘输入的全屏编辑观点? [英] Disabling the fullscreen editing view for soft keyboard input in landscape?

查看:192
本文介绍了禁用于景观软键盘输入的全屏编辑观点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用软键盘的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.
}

这篇关于禁用于景观软键盘输入的全屏编辑观点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆