I have a CardView with rounded corners, I want to have an ImageView at the top like shown in the example taken from the material design guidelines
i try to using combination with cardview and imageview, so it will be like this :
android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="160dp"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
app:cardCornerRadius="8dp"
android:elevation="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView">
I just adding the corner radius and elevation attribute on cardview, and scaletype = centerCrop on image view
Hope it will help