Android: EditText hint in single line

后端 未结 3 1995
别那么骄傲
别那么骄傲 2020-12-10 10:50

For setting the Single Line in EditText we use android:singleLine=\"true\" but I want to set the single line for the Hint Text, it is large and I w

相关标签:
3条回答
  • 2020-12-10 11:08

    You can use

    android:ellipsize="end"

    android:maxLines="1"

    to show your hint text in single line but you wont be able to see the whole text because android:ellipsize="end" truncates the text at the end.

    0 讨论(0)
  • 2020-12-10 11:09

    You can try using

    android:maxLines="1"
    
    0 讨论(0)
  • 2020-12-10 11:19

    Same issue.

    Solution:

    EditText.setHint("hint content".replace("\n"," "))
    
    0 讨论(0)
提交回复
热议问题