How to crop an image into a circle button in xml Android studio? -


this question has answer here:

hey guys i'm trying make circle button. , in circle want put image, person's profile picture. if uploads image, need able adjust size , crop , put circle. below example of trying accomplish. , behind circle red circle, aesthetics. hope guys can give me insight or direction. enter image description here

you can using imageview 2 properties: background , src

  1. get square image transparent circle
  2. set step 1 image src property of imageview
  3. set background of imageview avatar photo (square).

please see here static avatar image solution: imageview in circular through xml

if avatar dynamic, need set background image dynamically , post help:

changing image view background dynamically

if using picaso use this: android: create circular image picasso

however has great performance concerns.


Comments