Android: Remove Enter Key from softkeyboard

前端 未结 6 1401
余生分开走
余生分开走 2021-02-07 14:39

In my login form when user clicks on an EditText and presses the enter key, this inserts a new line, therefore increasing the EditText\'s size. Next moment, it returns to its pr

6条回答
  •  一个人的身影
    2021-02-07 15:32

    Inside the tag EditText you only have to do:

    android:singleLine="true"
    

    this remove the enter key in the keyboard

    UPDATE

    Inasmuch as android:singleLine="true" is deprecated I use android:maxLines="1" to avoid the enter in a EditText. How the name of the method says only N lines is permitted.

提交回复
热议问题