Mekillerow
Mekillerow

Reputation: 65

When Pressing "Enter" button on EditText is creating a new line

When I'm pressing "enter" on the keyboard, the EditText space is creating a new line and raising the space of EditText, disturbing my app layout. How can I stop this?

Thanks!

Upvotes: 2

Views: 3557

Answers (3)

Vinay John
Vinay John

Reputation: 1029

Try this when using TextInputEditText

android:inputType="text"
android:maxLines="1"

Upvotes: 3

Shmuel
Shmuel

Reputation: 3916

These 3 flags will solve your issue. Add them to your edit text view.

android:inputType="text"
android:imeOptions="actionNext"
android:maxLines="1"

Upvotes: 4

Hassan Semiu Ayomon
Hassan Semiu Ayomon

Reputation: 270

Make sure you set the attribute inputType of the EditText to text like

android:inputType="text"

Upvotes: 2

Related Questions