Android: Setting EditText Max Chars per Line?

前端 未结 7 1658
再見小時候
再見小時候 2021-01-15 02:29

Is there any way to set a maximum of Chars to a line in an EditText Field? I tried it with a TextWatcher, But I cant really do what I want.

<
7条回答
  •  滥情空心
    2021-01-15 03:11

    Add this in the layout:

    android:maxLength="10" // If you want 10 symbols entered in the EditText
    

    EDIT:

    android:lines="10" // For the numer of lines in the EditText
    

提交回复
热议问题