开发者

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. n开发者_如何学Goow 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.

help in android Edit Text

help in android Edit Text

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


android:singleLine="true" should work.


add this property for EditText and check...

android:singleLine="true"


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


android:maxLines="1"

Another property...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜