How to Create Multiline EditText in Android


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" />

 

 

About author


User avatar

Waqas Anwar

Founder of EzzyLearning.com, Senior Consultant, Microsoft .NET and Web Technologies

Comments