Disable Enter in editText android

前端 未结 10 1695
别那么骄傲
别那么骄傲 2021-02-05 03:15

I have an EditText but I want only one line. I put lime this

1


        
10条回答
  •  时光取名叫无心
    2021-02-05 03:51

    android:maxLines="1" allows the text to be multiline but limits the height of edittext to display a single line.

    If you want to disable the enter (new line) key, set the input type to text

        android:inputType="text"
    

提交回复
热议问题