I have an EditText and it has the following settings:

<EditText android:id="@+id/search_text_field" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:background="#00000000" android:hint="@string/search_placeholder" android:padding="5dp" android:textColor="@color/fdGeneralTextColor" android:textColorHint="@color/fdGrayTextColor" android:maxLines="1" android:textSize="14dp" android:layout_gravity="center_vertical" android:inputType="textAutoCorrect|textCapSentences|textMultiLine"/> 

If you write text and press enter, you can write from a new line. How to disable the second line?

    1 answer 1

    The textMultiLine attribute allows the input of multi-line text, it must be removed.

     android:inputType="textAutoCorrect|textCapSentences"/> 
    • For sure! Looks copied from another template and forgot to remove)) Thank you) - cheerful_weasel