fhucho
fhucho

Reputation: 34530

How to make EditText hint not to wrap?

I have a one line EditText, when I set a long hint, the hint wraps to two lines. Can I force the EditText to be always one line tall? android:lines="1" didn't work.

Upvotes: 11

Views: 4992

Answers (3)

M Karimi
M Karimi

Reputation: 3513

Use android:maxLines="1" or android:singleLine="true" instead of android:lines="1"

Upvotes: 0

mDiaz93
mDiaz93

Reputation: 319

Try android:singleLine="true"

Upvotes: 1

Kevin Coppock
Kevin Coppock

Reputation: 134664

Have you tried android:ellipsize yet? This can be set to truncate the line to end in "..." either at the start, the middle, the end, or you can set it to marquee (scroll across). Not sure offhand whether this applies to hints or not, but it should.

Upvotes: 18

Related Questions