我在姜饼上使用黑客和swiftkey x键盘。建议系列在键盘上方的大多数应用程序中显示。但是,在Android Market(现在播放商店)或DroidEdit(代码编辑器)中打开键盘时,我使用的任何键盘都没有显示该建议。
是什么决定了这种行为?如何打开/力暗示单词?
我在姜饼上使用黑客和swiftkey x键盘。建议系列在键盘上方的大多数应用程序中显示。但是,在Android Market(现在播放商店)或DroidEdit(代码编辑器)中打开键盘时,我使用的任何键盘都没有显示该建议。
是什么决定了这种行为?如何打开/力暗示单词?
I'm using Hacker's and SwiftKey X keyboard on GingerBread. Suggestion line is shown in most apps above the keyboard. But when opening the keyboard in Android Market (now Play Store) or DroidEdit (code editor), the suggestions aren't shown for any keyboard I use.
What determines this behaviour? How can I switch on/force suggesting words?
最有可能选择不向该特定输入框显示它们。从技术角度来看,这是由 TextView
对象上的标志控制,该对象表示文本区域控件(例如 TYPE_TEXT_FLAG_NO_SUGGESTIONS
选项)。如果应用程序选择禁用它,我不相信有任何方法可以覆盖此设置。
很重要的是要注意它有点单向街道。默认情况下,所有文本区域都会启用建议,但会遵守全局设置,因此应用程序无法以任何方式强制启用建议。如果您有全局设置关闭,他们无处不在。
开发人员文档提供允许应用程序强制禁用建议的逻辑是,在某些情况下,它们根本不太有用。具体的相关报价是(来自上述链接):
...这对不包含语言的单词的文本视图非常有用,并且不会从任何基于字典的完成或更正的文字中受益...
我正在下注市场禁用它们,因为应用程序名称和这些没有义务成为字典单词,所以建议尝试经常证明相当徒劳无功。我也会理解你的第二个例子也是如此,它听起来像源代码编辑器(我认为这就是你的意思是"语法突出显示" )。它是一种类似于Visual Studio在源代码中的错头击败词语 - 它提供了没有任何好处,因为大多数文本不是字典单词。
Most likely the app has chosen not to show them for that particular input box. From a technical perspective, this is controlled by flags on the TextView
object that represents the text area control (e.g. the TYPE_TEXT_FLAG_NO_SUGGESTIONS
option). I don't believe there is any way to override this setting if the app chooses to disable it.
It's probably also important to note that it's a bit of a one-way street. Suggestions are enabled by default on all text areas, but will obey the global setting, so an app can't forcibly enable suggestions in any way. If you have the global setting turned off, they're off everywhere.
The logic that the developer documentation provides for allowing apps to forcibly disable suggestions is that in some cases they simply aren't very useful. The specific relevant quote would be (from the above link):
... This is useful for text views that do not contain words from the language and do not benefit from any dictionary-based completions or corrections ...
I'd wager the Market disables them because app names and such have no obligation to be dictionary words, so suggestion attempts would often prove rather futile. I would also understand the same being true of your second example, which sounds like a source code editor (I assume that's what you mean by "syntax highlighting"). It would be sort of akin to Visual Studio underlining misspelt words in source code - it provides no benefit since most of the text will not be dictionary words.
© 2022 it.wenda123.org All Rights Reserved. 问答之家 版权所有