TextView's ellipsize not working on maxLines = 1

前端 未结 3 805
梦毁少年i
梦毁少年i 2021-01-05 04:31

I really cannot figure out why, but I am only able to get ellipsize working on maxLines=2 and more. I am displaying a few words of description and then a long s

3条回答
  •  一生所求
    2021-01-05 04:53

    There are two ways to fix it:

    1. Try to change android:ellipsize="end" attribute to android:ellipsize="marquee".
    2. Try to remove android:maxLines="1" android:ellipsize="end" attributes and add android:singleLine="true" attribute.

提交回复
热议问题