开发者

How to enable IME word auto-suggest in an Android EditText?

开发者 https://www.devze.com 2023-01-18 01:22 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消