android - 没有建议在 android 中使用多行编辑文本

标签 android android-edittext

我想在 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/

相关文章:

Android 通知不显示

java - Android dagger 2.11 中的 BroadcastReceiver

android - 在 App Billing Subscription 中,检查是否已订阅

android - 如何在 edittext + listview 布局中隐藏键盘

java - 将 TextView 文本设置为与 EditText 字段文本颜色相同的颜色

Android webview 不会加载我的 URL 但会加载其他

android - 为什么两个并行数组比单个数组存储元组更快

android - @EditText值开头

java - 如何在android中点击动态创建的编辑文本时获取编辑文本的ID?

android - 在 Android 中为我的 EditText 实现 InputFilter 的问题