如何添加单词的建议对软键盘的顶部 [英] How do i add words to the suggestions on top of the soft keyboard
问题描述
有没有什么办法可以增加在软键盘字的建议? 对于一个具体的EDITTEXT领域我想名称列表添加到弹出的软键盘顶部的Android 2.0的建议。
Is there any way to add words to the suggestions in the soft keyboard? For a specific Edittext field i would like to add a list of names to the suggestions that pops up on top of the soft keyboard in android 2.0.
有谁知道这是可能的吗?
Does anyone know if this is possible?
推荐答案
的这里是软键盘的来源$ C $ C。
如果你去通过code,你会看到它使用了推荐
类,它里面有不同的字典。
Here is the source code of the soft keyboard.
If you go through the code, you will see that it uses a Suggest
class which inside has different dictionaries.
如果您要添加的话特定的EditText
你需要添加和这些字典中删除或某一个字的变化频率。
If you want to add words for a specific EditText
you would need to add and remove or change freq of a certain word from those dictionaries.
一些问题:
- 在我没有找到一个办法让InputMethodService的实例。 (如果可以,请在这里回答我的问题)
- 的Android允许开发者编写他们自己的 InputMethodService 一>。我工作在一个我自己和我的实现不使用词典。所以,你的功能将不符合我的IME工作。
- I couldn't find a way to get the InputMethodService's instance. (If you can, please answer my question here)
- Android allows developers to program their own InputMethodService. I am working on one myself and my implementation doesn't use that dictionaries. So your feature will not work with my IME.
我会建议使用自动完成
这篇关于如何添加单词的建议对软键盘的顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!