gpt4 book ai didi

android - 从用户的角度来看,禁用横向软键盘输入的全屏编辑 View ?

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:39:55 25 4
gpt4 key购买 nike

我正在寻找 this exact question 的答案,而是站在用户的角度。也就是说,如果平板电脑显示正常的应用程序 UI,即使键盘在横向模式下可见,是什么导致手机不这样做?我讨厌那个“全屏”编辑框,更愿意看到应用程序正常 UI 的剩余一半(尽管它可能不那么明显;对于今天的大手机,仍然有“大量”可用的屏幕空间)。

例如,是否存在配置文件,可以在其中调整设置(即让设备相信其屏幕更大,或类似的效果)?我完全知道这可能需要 root 权限,对此我没有意见。明确地说,我知道更改所有“违规”应用既不可行也不可取。

我知道这不是严格意义上的编程问题,但要将能够获得一些合理搜索结果的短语放在一起是极其困难的。作为记录,我使用的是 Nexus 4,但问题基本上与设备和版本无关。

最佳答案

根据docs :

IME_FLAG_NO_EXTRACT_UI: For input methods that may be fullscreen, often when in landscape mode, this allows them to be smaller and let part of the application be shown behind. Though there will likely be limited access to the application available from the user, it can make the experience of a (mostly) fullscreen IME less jarring. Note that when this flag is specified the IME may not be set up to be able to display text, so it should only be used in situations where this is not needed.

由于手机的屏幕空间较小,这可能会使用户更难看到整个用户界面并能够正确操作它,尤其是当您有一些“较高”的用户界面元素可能无法适应屏幕时横向模式。

更新:从操作系统层面来看,解决方案位于(至少在 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) 并在不调用 super 的情况下可能调用 setExtractViewShown(false)

关于android - 从用户的角度来看,禁用横向软键盘输入的全屏编辑 View ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14166753/

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