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" />
Just add this android:inputType="textMultiLine" in XML file on relevant field. Save this answer.
The android:inputType attribute allows you to specify various behaviors for the input method. Most importantly, if your text field is intended for basic text input (such as for a text message), you should enable auto spelling correction with the "textAutoCorrect" value.
Set the Text of Android EditText In android, we can set the text of EditText control either while declaring it in Layout file or by using setText() method in Activity file. Following is the example to set the text of TextView control while declaring it in XML Layout file.
Change:
android:inputType="text"
to:
android:inputType="textMultiLine"
Works for me!
<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"
android:singleLine="false" />
android:singleLine="false" will make editText to support multiple lines
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With