I have a ListView with contact images and names or numbers. Now I want to round the corners of this contact image.
public View getView(final int
If you are trying to make your imageview as rounded corner
You can achieve this multiple ways
Method 1:: Use a background drawable which is rounded image(You can use nine-patch)
Method 2:: You can use these links
Here is an demo answer
just use XML in case you have some space around the image:
Create a bordered shape with transparent content like this:
Then in a RelativeLayout you can first place your image and then in the same location above the shape with another ImageView. The cover-shape should be larger in size by the amount of the border width. Be careful to take a larger corner radius as the outer radius is defined but the inner radius is what covers your image.
Hope it helps somebody, too.
Edit as per CQM request the relative layout example:
Hope it helps