- Create a Values Resources file under "values". I named it "Style".
- Write this code in styles.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="roundImageView">
<item name="cornerFamily">rounded</item>
<item name="cornerSize">50%</item>
</style>
</resources>
3. Write code in your XML file
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:id="@+id/list_item_image"
app:shapeAppearanceOverlay="@style/roundImageView"
android:src="@drawable/mm"
android:scaleType="centerCrop"
/>
Comments
Post a Comment