Setting Ellipsize on TextView reduces lines shown by one (instead of only ellipsizing last)

前端 未结 6 604
慢半拍i
慢半拍i 2020-12-12 16:29

when I am using TextView with singleLine="true" and ellipsize="end"(my top TextView), it works well

<
6条回答
  •  心在旅途
    2020-12-12 16:48

    Use the following to get a multiline textview with ellipsis on the last line :

    android:maxLines="4"
    android:ellipsize="end"
    android:singleLine="false"
    

    Replace 4 with the number of lines you want. Hope it helps !

提交回复
热议问题