How can I make my EditText five lines high without using android:inputType="textMultiLine"?

Mel picture Mel · Oct 3, 2011 · Viewed 8.6k times · Source

I want to have a EditText view that is five lines high. I want it five lines high for visual appeal reasons only (so that it does not appear cramped). The code below does not work, the EditText appears only one line high.

I have tried multilinetext and it works visually, however I want to abandon it as I want the virtual keyboard to say "Next" (rather than have the enter key that is automatically provided with multiline text)

How can I make my EditText box bigger? Alternatively, how can I use the imeOption "actionNext" with multiline text?

This code does not work...

<EditText
        android:id="@+id/etEdit"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="top"
        android:inputType="text"
        android:lines="5"  //this has no effect!
        android:imeOptions="actionNext"
        style="@style/dialogInput" />  

Answer

keynetic picture keynetic · May 1, 2014

Change:

android:inputType="text"

to:

android:inputType="textMultiLine"

Works for me!