转载于
https://ask.csdn.net/questions/767643
https://img-ask.csdn.net/upload/201906/29/1561800129_18569.gif
做个备份,记录,自用,方便查找
效果图

code
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tvs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:textSize="24sp"
app:layout_constrainedWidth="true"
app:layout_constraintEnd_toStartOf="@+id/view"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:text="我是内容我是内容" />
<View
android:id="@+id/view"
android:layout_width="80dp"
android:layout_height="30dp"
android:background="#f00"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toEndOf="@+id/tvs" />
</android.support.constraint.ConstraintLayout>
网友评论