when I try to use : android.support.v4.widget.CircleImageView
The CircleImageView
is a private class of the support library and cannot be used. But it is easy to create this effect yourself without the CircleImageView
. You just need to define a
drawable with a transparent circle in the middle similar to this:
After that just combine the image you want to display in the ImageView
with the
drawable from above in a LayerList
like this:
If the image you want to display is dynamic then you can create the LayerList
programmatically!