Android: Setting EditText Max Chars per Line?

前端 未结 7 1655
再見小時候
再見小時候 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 02:56

    You can use following properties:-

     android:maxLength="5";
    

    if want single line:-

         android:singleLine="true";
    

    else for fix lines:-

         android:maxLines="5";
    

提交回复
热议问题