开发者

Android singleline texthint

开发者 https://www.devze.com 2022-12-28 08:42 出处:网络
The setHint and singleLine settings don\'t seem to be able to work together. If my hint is longer than a single line and I have

The setHint and singleLine settings don't seem to be able to work together. If my hint is longer than a single line and I have singleLine set to true, the editText box automatically spans to 2 lines regardless.

Does anyone have 开发者_如何学Pythona workaround?


I tried to do:

textView.setHint("Veeeeeery looooooong hiiiiiiint");
textView.setEllipsize(TruncateAt.END);
textView.setSingleLine();

and it seems to work. The hint is truncated with ellipsize at the end.

0

精彩评论

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