I have a simple ImageView of a trashcan which I imported as a vector asset. This is the XML
<ImageView
android:id="@+id/trashcan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="8dp"
android:elevation="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/ABtn"
app:layout_constraintTop_toTopOf="parent"
android:background="@drawable/ic_trashcan" />
Why is it that the shadow does not show even with elevation? I would like to avoid using a cardview container and use its shadow because otherwise I would have to enclose any kind of ImageView in a cardView just for that reason.
The above ImageView's parent is a ConstraintLayout.
Adding android:outlineProvider="paddedBounds" showed the elevation shadow. Does anyone know why?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With