3
Put the attribute below in the EditText
in question
android:singleLine="true"
EDIT
As stated, the android:singleLine
was discontinued from API 3. You will have to use android:maxLines
. In your case, android:maxLines="1"
.
singleLine has been discontinued for performance reasons, but will not be removed due to some effects maxLines
can’t do.
For example, the code below a horizontal scrollable text in a row, if the text is selected.
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="end"
android:scrollHorizontally="true" />
That code does not
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:scrollHorizontally="true" />
Link to the source.
It worked. Thank you.
– Artur Mafezzoli Júnior