0

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?

Dima
  • 1,189
  • 1
  • 8
  • 12
  • 1. Dima, rename your account to eng style, because it's eng site, and it's hard to write your name with cyrillic letters 2. Your code is ok, but you also need to add `app:cardBackgroundColor="@color/white" app:layout_constraintTop_toTopOf="@+id/imageView"` to `CardView` – NickUnuchek Jan 30 '19 at 12:40
  • Thank you, I've renamed the account. But other advices didn't work ( android 4.4 – Dima Jan 30 '19 at 13:08
  • What is the root layout (edit question and add it)? Try to use `FrameLayout` instead of `ConstraintLayout` – NickUnuchek Jan 30 '19 at 13:15

0 Answers0