Android TextView with multiline and “android:ellipsize = middle”

后端 未结 5 1480
我寻月下人不归
我寻月下人不归 2020-12-21 04:25


        
5条回答
  •  遥遥无期
    2020-12-21 05:14

    If setMaxLines(int) has been used to set two or more lines, only TextUtils.TruncateAt.END and TextUtils.TruncateAt.MARQUEE are supported (other ellipsizing types will not do anything). https://developer.android.com/reference/android/widget/TextView.html#attr_android:ellipsize

    if you want to use textview with 2 lines and ellipsize=middle you can divide your text in half and to do use it

          
            
    

    it looks like this

提交回复
热议问题