我想在 android 中实现Multiline EditText with no suggestion。我在谷歌上搜索了很多,发现以下代码:
noticeEditText.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
或
noticeEditText.setInputType( android.text.InputType.TYPE_CLASS_TEXT | android.text.InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD );
或
在布局文件中:
android:inputType="textFilter"
但我的问题是,没有任何建议,Edit Text 是单行。 我还添加了以下属性:
noticeEditText.setSingleLine(false);
noticeEditText.setVerticalScrollBarEnabled(true);
noticeEditText.setHorizontalScrollBarEnabled(false);
但仍然单行编辑 TextView 。我应该怎么做才能获得没有建议的多行编辑 TextView 。
谢谢。
最佳答案
试试这个,你会很高兴:
android:inputType="textFilter|textMultiLine|textNoSuggestions"
它应该适合你。
关于android - 没有建议在 android 中使用多行编辑文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18307145/