如何添加单词的建议对软键盘的顶部 [英] How do i add words to the suggestions on top of the soft keyboard

查看:113
本文介绍了如何添加单词的建议对软键盘的顶部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有什么办法可以增加在软键盘字的建议? 对于一个具体的EDITTEXT领域我想名称列表添加到弹出的软键盘顶部的Andr​​oid 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.

一些问题:

  • 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屋!

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