如何启用在Android的EditText IME字自动建议? [英] How to enable IME word auto-suggest in an Android EditText?

查看:251
本文介绍了如何启用在Android的EditText IME字自动建议?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文本字段,当我使用IME(缺省之一的Nexus One),它不会显示在软键盘上方的自动提示线。

讽刺的是这里还有关于如何prevent自动提示,但在我的情况下,它的复归,它不显示职位,目前还不清楚为什么。

下面是我的布局标签。我在API 8。

 <的EditText
  机器人:ID =@ + ID / USER_TEXT
  机器人:layout_width =FILL_PARENT
  机器人:layout_height =FILL_PARENT
  机器人:layout_weight =1
  机器人:重力=顶
  机器人:单线=假
  安卓的inputType =textLongMessage | textCapSentences | textMultiLine | textAutoCorrect | textAutoComplete
  机器人:提示=@字符串/ errorreport_user_hint
  机器人:paddingLeft =5dip
  机器人:paddingRight =5dip
/>


解决方案

嗯得到了它,我不应该使用 textAutoCorrect 标记。
我认为这将要求IME显示自动修正,而不是文档表明它意味着编辑器提供了自动更正(我猜如AutoCompleteEditText),从而使IME不应该弹出自动提示。

I have a text field and when I use the IME (the default one for Nexus One) it doesn't display the auto-suggest line on top of the soft keyboard.

Ironically there are posts here on how to prevent the auto-suggest, but in my case it's the revert, it doesn't show up and it's not clear why.

Here's my layout tag. I'm in API 8.

<EditText
  android:id="@+id/user_text"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:layout_weight="1"
  android:gravity="top"
  android:singleLine="false"
  android:inputType="textLongMessage|textCapSentences|textMultiLine|textAutoCorrect|textAutoComplete"
  android:hint="@string/errorreport_user_hint"
  android:paddingLeft="5dip"
  android:paddingRight="5dip"
/>

解决方案

Ah got it, I should not use the textAutoCorrect flag. I thought it would ask the IME to display auto-correction, instead the doc indicates it means the editor is providing auto-corrections (I guess such as AutoCompleteEditText) and thus the IME should not display the auto-suggests.

这篇关于如何启用在Android的EditText IME字自动建议?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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