How to make an image circular and give it white circular border? Is it necessary to use two image views – one for the image and other for the white border? Is there any other wa
This may not be the best way and you may not be able to change a lot of properties, but it is surely the easiest way. I just used this library and I made a circular imageview that has also a border.
So, this is my solution:
First, I put this in my build.grandle
:
`compile 'com.github.siyamed:android-shape-imageview:0.9.+@aar'`
Second, I put this in my .xml
layout file:
In my .java
file, this is the way I can take or set the image to the CircularImageView
:
final com.github.siyamed.shapeimageview.CircularImageView photo = (com.github.siyamed.shapeimageview.CircularImageView) convertView.findViewById(R.id.photo);
photo.setBackgroundResource(R.drawable.female);
That's all I've done to do the an image circular with white border.