TextView 最多显示2行,每行最多10个字,多余的显示....

 

<TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:lines="2"
        android:maxEms="10"
        android:ellipsize="end"
        android:paddingTop="10dp"
        android:text="@string/search_info"
        android:textColor="@color/white"
        android:textSize="10dp" />

 

android:lines=”1”:只显示一行 
android:ellipsize=”end”:超出部分显示省略号… 
android:maxEms=”8”:可以参见这位同学的实验 ,url 地址

设你输入的参数为n, textview显示的数量为m。 
值为1-5时,m = n.. 
6-11时,m = n+1。 
12-18时,m = n+2。

尊重作者劳动成果:https://blog.csdn.net/u012060443/article/details/71633950

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章