ImageView in circular through xml

前端 未结 27 1301
死守一世寂寞
死守一世寂寞 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 10:52

    I have a simple solution. Create a new Image asset by right clicking your package name and selecting New->Image asset. Enter name (any name) and path (location of image in your system). Then click Next and Finish. If you enter name of image as 'img', a round image with the name 'img_round' is created automatically in mipmap folder.

    Then, do this :

    
    

    Your preview may still show a rectangular image. But if you run the app on your device, it will be round.

提交回复
热议问题