Reputation: 21
I want to add a ViewAnimator
using ConstraintLayout
. I did it using RelativeLayout
but I am not able to do the same using ConstraintLayout
. In fact there isn't any such option, there is horizontal and vertical divider. The screenshot given is what I want using ConstraintLayout
, I did that with RelativeLayout
. Here is the code for ViewAnimator
<ViewAnimator
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginTop="16dp"
android:background="@android:color/darker_gray" />
I only need the vertical line
Upvotes: 2
Views: 3167
Reputation: 1535
Set the height 0dp
and then use topof and bottomof parent or any view.
<ViewAnimator
android:layout_width="1dp"
android:layout_height="0dp"
android:layout_marginTop="16dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:background="@android:color/darker_gray" />
also for vertical div you can use <View />
tag.
Upvotes: 4