반응형
view를 visible, gone하면서 ui를 일정하게 유지하고 싶었다.
How to set constraint to two views?
<ConstraintLayout>
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier"
app:barrierDirection="left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="view1,view2"/>
<TextView
android:id="@+id/text_view"
app:layout_constraintEnd_toStartOf="@id/barrier" />
<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"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</ConstraintLayout>
https://stackoverflow.com/questions/50047796/how-to-set-constraint-to-two-views
반응형
댓글