I am trying to make a rounded Image View but I am getting an improper output. I am attaching the photo
These are the xml files used for this
circle.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:innerRadius="0dp"
android:shape="ring"
android:thicknessRatio="1.9"
android:useLevel="false" >
<solid android:color="@android:color/transparent" />
<stroke
android:width="10dp"
android:color="@android:color/white" />
</shape>
img.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/circle"/>
<item android:drawable="@drawable/ic_add_photo"/>
</layer-list>
The image view for this is:
<ImageView
android:id="@+id/iv_dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/iv_person"
android:layout_below="@+id/iv_person"
android:layout_marginTop="37dp"
android:adjustViewBounds="true"
android:background="@drawable/img"
android:cropToPadding="true" />
you can use external lib like
Or use custom as
You can use
CirlcleImageView
library for roundedImageView
:compile this libray
Usage
for more information follow this link
Try this