ImageView in circular through xml

前端 未结 27 1044
死守一世寂寞
死守一世寂寞 2020-11-22 10:35

I\'d Like to make any image from my ImageView to be circular with a border.

I searched but couldn\'t find any useful information (anything that I tried

27条回答
  •  失恋的感觉
    2020-11-22 11:05

    The above methods don't seem to work if you're using the src attribute. What I did is to put two image views inside a frame layout one above another like this:

    
    
        
    
        
    
    
    

    Simply put a circular_crop.png in your drawable folder which is in the shape of your image dimensions (a square in my case) with a white background and a transparent circle in the center. You can use this image if you have want a square imageview.

    Just download the picture above.

提交回复
热议问题