Android EditText Multiline

June 18, 2018

EditText Multiline

  • Use inputType="textMultiLine". textCapSentences and textNoSuggestions are nice options as well.
  • To distinguish mltiline’s UI from singleline, you might want to use minLines="3"
  • To avoid text and hint appearing in center vertically, use gravity="top"
<EditText
    android:id="@+id/descriptionEditText"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:minLines="3"
    android:maxLines="6"
    android:hint="Description"
    android:gravity="top"
    android:inputType="textCapSentences|textNoSuggestions|textMultiLine" />
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.