How to overlay view in constraint layout?

943 Views Asked by At

I have image view in Constraint Layout and want CardView to overlay it. xml:

<com.makeramen.roundedimageview.RoundedImageView

    android:id="@+id/imageView"
    android:layout_width="match_parent"

    android:layout_height="0dp"

    android:layout_marginEnd="8dp"
    android:layout_marginLeft="16dp"
    android:layout_marginRight="16dp"
    android:layout_marginStart="8dp"
    android:layout_marginBottom="16dp"

    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/line"

    app:layout_constraintBottom_toTopOf="@id/btn1">

<android.support.v7.widget.CardView
    android:id="@+id/text_card"
    style="@style/CardViewStyle"
    android:layout_width="0dp"


    android:layout_height="wrap_content"

    android:layout_marginBottom="4dp"
    android:visibility="invisible"
    app:layout_constraintBottom_toBottomOf="@+id/imageView"
    app:layout_constraintEnd_toEndOf="@+id/imageView"
    app:layout_constraintHorizontal_bias="0.0"
    app:layout_constraintStart_toStartOf="@+id/imageView">

On modern devices everything is ok But with api lower 19 ImageView overlays CardViews. How can I fix it?

0

There are 0 best solutions below