How can I show ellipses on my TextView if it is greater than the 1 line?

后端 未结 7 1331
终归单人心
终归单人心 2020-11-30 22:19

I have the following Layout which does not work:



        
7条回答
  •  孤街浪徒
    2020-11-30 22:44

    Use this

    android:ellipsize="end"  
    android:singleLine="true"
    

    Don't use this without fully aware of what output comes

    android:ellipsize="end"  
    android:maxLines="1"
    

    When you use maxlines = 1 it will some time truncate most of the characters.

提交回复
热议问题