【问题标题】:TextView on android only shows two lines worth of text in either orientationandroid上的TextView仅在任一方向上显示两行文本
【发布时间】:2010-06-25 21:47:34
【问题描述】:

如果文本比文本视图的宽度长,在第二行之后,它会剪切它并在它的末尾添加“...”。方向无关紧要,它只会显示更多文本,直到第二行结束,这里是 textview XML:

<TextView android:id="@+id/ContentViewerDescription"
                android:layout_width="wrap_content" 
                android:layout_height="match_parent"
                android:layout_weight="1" 
                android:ellipsize="end"
                android:maxLines="20"
                android:textColor="#999999"
                android:layout_marginTop="10px"
                android:layout_marginLeft="10px"/>

【问题讨论】:

    标签: java android textview


    【解决方案1】:

    更改为android:layout_height="wrap_content" 并删除android:ellipsize="end"

    【讨论】:

    • 谢谢你,我什至没有想到 match_parent 可能与它有关......
    • 其实就是 android:ellipsize="end"
    • 奇怪,为什么 ellipsize 与 > 2 行不兼容?
    猜你喜欢
    • 1970-01-01
    • 2015-12-19
    • 2011-12-14
    • 2012-09-03
    • 2022-01-08
    • 2011-06-14
    • 2014-09-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多