How to Create Multiline EditText in Android

Waqas Anwar
25 July 2011
11422 Views

There is no separate control for creating multiline text boxes in Android. You can use same EditText control and set some of its properties to make it multiline EditText as shown in the code below:

<EditText
    android:layout_width="fill_parent"            
    android:layout_height="wrap_content"
    android:gravity="top|left"            
    android:singleLine="false"
    android:lines="5"            
    android:inputType="textMultiLine"
    android:scrollHorizontally="false" />