line break of an edittext automatically on android

0

Hello! in my application the client can make a comment with up to 300 characters, but it is bad to do long texts with edittext in only one line So how to break the line automatically? an example is when we will make comments on facebook, the text will break the line and go down instead of disappearing as usual in edittext,

An example in my edittext: Lorem Ipsum is simply a typeface text simulation

I would like it to look like this: Lorem Ipsum is simply a simulation  typographic industry text
Lorem Ipsum is simply a simulation  typographic industry text
Lorem Ipsum is simply a simulation of typographic industry text

    
asked by anonymous 06.08.2018 / 00:06

1 answer

0

You can use the attributes maxLines and / or inputType , like this:

  <EditText
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:maxLines="5"
       android:inputType="textMultiLine"
       android:textSize="16sp" />

In your case, I believe that only using inputType="textMultiLine" will resolve, and the text will break as you insert.

    
06.08.2018 / 15:17