Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android EditText not Multi Line [duplicate]

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?

like image 783
Ms. B Avatar asked Jan 29 '13 06:01

Ms. B


2 Answers

Try this in your EditText xml

android:singleLine="true"
like image 149
IssacZH. Avatar answered Oct 03 '22 07:10

IssacZH.


 <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

like image 36
edwin Avatar answered Oct 03 '22 07:10

edwin