TextView Ellipsize (…) not working

后端 未结 6 2088
醉梦人生
醉梦人生 2020-12-29 20:55

I want to have a single lined TextView to show up 3 dots at the end when the text is longer than the TextView. I don\'t know why - but I don\'t get

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-29 21:37

    Add this in your xml for the TextView:

            android:maxWidth="200dp" 
            android:maxLines="1" 
    

    As

            android:singleLine="true"  
    

    is deprecated.

提交回复
热议问题