Shah
Shah

Reputation: 5020

help in android Edit Text

hi all i have a lil problem in android edit text actually i made an app in which i m using two text fields for user name and password and set EditText size manually like in 200dip format. now when there is no text in the Edit Text it is in perfect size like in the image below but when we start typing text and the text exceeds the size of editText Field then it Expand downwards like in second image below. EditText Before EditText After in Expanded shape

What I want is that when text exceeds the size of EditText, it should not Change its size. please help

Upvotes: 1

Views: 1214

Answers (4)

BadSkillz
BadSkillz

Reputation: 2003

android:maxLines="1"

Another property...

Upvotes: 0

Mojo Risin
Mojo Risin

Reputation: 8142

You have to do your ExitText to be single line. You can use android:singleLine but it is deprecated and it's replaced by android:inputType. Use android:inputType=text for single line and android:inputType=textMultiline for multiline

Upvotes: 2

Niranj Patel
Niranj Patel

Reputation: 33258

add this property for EditText and check...

android:singleLine="true"

Upvotes: 2

Henrik
Henrik

Reputation: 1157

android:singleLine="true" should work.

Upvotes: 2

Related Questions