Android: Multiline & No autosuggest in EditText

2019-02-16 21:39发布

Is it possible to have an EditText that allows multilines and doesn't show the suggestions? I tried with this code:

android:inputType="textFilter|textMultiLine"

Which I saw in this question, but it didn't work for me. If I try to use both at the same time, the EditText supports multiline, but the suggestions appear. Separately, they work properly.

Is this a bug in the SDK? Or maybe it is not possible to combine them?

Thanks!

7条回答
放荡不羁爱自由
2楼-- · 2019-02-16 22:15

If you created Edittext Dynamically and want to achieve Multiline & No autosuggest then you need to use: setRawInputType

editText.setRawInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
查看更多
登录 后发表回答