Set EditText to be Multiline(Enter is carrige return) and not display suggestions

[亡魂溺海] 提交于 2019-12-12 06:52:39

问题


I am trying to set a Android EditText to be Multiline, and not display any suggestions.

    textView.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS | InputType.TYPE_TEXT_FLAG_IME_MULTI_LINE);

However, this is just a single line. Currently pressing the enter/carriage return button hides the keyboard, instead of moving to a new line.

        textView.setImeOptions(EditorInfo.IME_FLAG_NO_ENTER_ACTION);

Setting the IME flag causes the enter button to insert whitespace. I need to display no suggestions and also have the EditText to be multiline. Am I missing something here?


回答1:


I have solved this issue. I was using SwiftKey keyboard, swapping to the default Google keyboard seems to work perfectly. My guess is swiftkey doesn't have some of these methods implemented?



来源:https://stackoverflow.com/questions/23430328/set-edittext-to-be-multilineenter-is-carrige-return-and-not-display-suggestion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!