如何使的EditText暗示不换?暗示、EditText

2023-09-06 02:59:08 作者:羁旅客

我有一条线的EditText,当我设置一个长的提示,提示换到两行。我可以强制的EditText是总有一个行高? 机器人:行=1没有工作

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.

推荐答案

你试过安卓ellipsize 吗?这可以被设置为截断结束在该行......无论是在开始,中间,结尾,或者你可以将其设置为选取框(滚动跨越)。不知道副手这是否适用于暗示或没有,但它应该。

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.