How to retrieve multi-line text from Edittext?

后端 未结 4 1177
有刺的猬
有刺的猬 2020-12-17 06:08

I want to get a text(Multi-line) from Edittext same as given Screenshot.

I want below output when getText() from Edittext.

Output:

4条回答
  •  执笔经年
    2020-12-17 07:06

    By default all the EditText widgets in Android are multi-lined. And you can configure the number of lines and the characters types. By setting the input type to multiline do the trick.

    
       ...
       android:lines="8" 
       android:minLines="6" 
       android:gravity="top|left" 
       android:maxLines="10" 
       android:layout_height="wrap_content" 
       android:layout_width="match_parent" 
       android:scrollbars="vertical" 
    />
    

提交回复
热议问题