Home » Android » eclipse – Android EditText not Multi Line

eclipse – Android EditText not Multi Line

Posted by: admin May 14, 2020 Leave a comment

Questions:

Possible Duplicate:
restrict edittext to single line

I have 2 edit texts. My problem is, when I press the enter button in the keyboard, it creates another set of line. Or it creates like a next line in my edit text. I want to remove it and I want it to be in single line. Even if I enter the enter key in the keyboard, still it won’t create a next line.

How do you do it?

How to&Answers:

Try this in your EditText xml

android:singleLine="true"

Answer:

 <EditText
    android:id="@+id/edittextView1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:maxLines="1"
    android:singleLine="true"/>

Try this with your edit text in layout