根据文档:
IME_FLAG_NO_EXTRACT_UI:对于可能是全屏的输入法,通常在横向模式下,这允许它们更小,并让部分应用程序显示在后面。尽管用户对应用程序的访问可能会受到限制,但它可以使(大部分)全屏 IME 的体验不那么刺耳。请注意,当指定此标志时,IME 可能无法设置为能够显示文本,因此它应该只在不需要的情况下使用。
由于手机的屏幕空间较小,因此可能会使用户更难看到整个 UI 并能够正确操作它,尤其是如果您有一些“较高”的 UI 元素在横向模式下可能不适合屏幕。
更新:从操作系统级别的角度来看,解决方案位于(至少在 ICS 中)android/inputmethodservice/InputMethodService.java:2107
:
/**
* Called when the fullscreen-mode extracting editor info has changed,
* to determine whether the extracting (extract text and candidates) portion
* of the UI should be shown. The standard implementation hides or shows
* the extract area depending on whether it makes sense for the
* current editor. In particular, a {@link InputType#TYPE_NULL}
* input type or {@link EditorInfo#IME_FLAG_NO_EXTRACT_UI} flag will
* turn off the extract area since there is no text to be shown.
*/
public void onUpdateExtractingVisibility(EditorInfo ei) {
if (ei.inputType == InputType.TYPE_NULL ||
(ei.imeOptions&EditorInfo.IME_FLAG_NO_EXTRACT_UI) != 0) {
// No reason to show extract UI!
setExtractViewShown(false);
return;
}
setExtractViewShown(true);
}
要删除此功能,您可能必须在不调用的情况下覆盖onUpdateExtractingVisibility(EditorInfo)
并调用inside 。setExtractViewShown(false)
super