10

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?

Community
  • 1
  • 1
Ms. B
  • 1,073
  • 6
  • 15
  • 26

2 Answers2

31

Try this in your EditText xml

android:singleLine="true"
IssacZH.
  • 1,457
  • 3
  • 24
  • 54
9
 <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

edwin
  • 7,985
  • 10
  • 51
  • 82