Android Studio version: 2.3.3, Android 4.3
I am using CardView and want to round image's corners.
Layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="@dimen/card_width"
android:layout_height="@dimen/card_width"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
card_view:cardCornerRadius="15dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/img_lights" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
As you can ses I set
card_view:cardCornerRadius="15dp
Here is the result:
But image's corners is not rounded. Why?