1

我知道这个问题已经被问过很多次了,但我似乎仍然无法让它发挥作用。我尝试了各种组合,但它只是拒绝换行到 2 行。

现在是这样的:

    <TextView
        android:id="@+id/doctor_details_clinic_name"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:paddingRight="3dip"
        android:textSize="12sp"
        android:maxLines="1"
        android:layout_gravity="right"
        android:gravity="right"
        android:scrollHorizontally="false"
        android:singleLine="false"
        android:ellipsize="none"
        />

我试过让宽度为 0dip 和所有其他建议的东西,但不符合。

4

1 回答 1

1

首先,您应该将 Max lines 设置为 2 而不是 1。这样的事情会起作用:

    <TextView
        android:id="@+id/myText"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:maxLines="2"
        android:ellipsize="end"
        android:text="this is the most interesting use of text view I have seen so far,this is the most interesting use of text view I have ever seen so far,this is the most interesting use of text view I have ever seen so far this is the most interesting use of text view I have ever seen so far"/>
于 2012-08-22T06:34:54.617 回答