所以我有一个像这样的ConstraintLayout
<ConstraintLayout>
<TextView
android:id="@+id/text_view"
app:layout_constraintEnd_toStartOf="@+id/view1" />
<View
android:id="@+id/view1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<View
android:id="@+id/view2"
aapp:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</ConstraintLayout>
目前,TextView的末尾位于View1的开头,但是当View1不可见时,我希望TextView的末尾位于View2的开头,否则长字符串可能会覆盖View2。是否有方法将约束设置为两个视图,或者是否有更好的解决方案?