TextView cuts off text when it is long enough

后端 未结 6 1360
执笔经年
执笔经年 2021-01-31 11:16

I have strange problem with TextView, it cuts off part of the text at the end. My layout looks like



        
6条回答
  •  粉色の甜心
    2021-01-31 11:35

    Make use of these attributes

        android:lines="1"
        android:scrollHorizontally="true"
        android:ellipsize="end"
    

    will append "..." at the end. But this will not solve problem in honeycomb tab

    So for honeycomb tablet add the following atttibute also

    android:singleLine="true" 
    

    On the other hand if you require marquee effect

    android:singleLine="true"
    android:ellipsize="marquee" 
    android:marqueeRepeatLimit="marquee_forever"
    android:scrollHorizontally="true" 
    android:focusable="true" 
    android:focusableInTouchMode="true
    

提交回复
热议问题