Making an image circular with white circular border

后端 未结 10 2332
甜味超标
甜味超标 2021-02-19 19:32

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

10条回答
  •  不要未来只要你来
    2021-02-19 20:07

    By using this link i have successfully made it, using a FrameLayout and two RoundedImageView. The logic behind what i did is one is a wrapper view and one is the view with the profile image. Here is my code

    XML code:

        
    
    
        
    
        
    
    

    JAVA code :

    profileWrapper.setImageResource(R.drawable.white_background);
    profile.setImageResource(R.drawable.profile);
    

    hope it helps, if you have any confusion please comment below.

提交回复
热议问题