Adding borders for image rounded image android

前端 未结 4 1093
夕颜
夕颜 2020-12-02 23:33

What i have:: I have a Imageview for which i am making image as a circle using picassso \"enter

4条回答
  •  误落风尘
    2020-12-03 00:29

    you can use drawCircle with another Paint object. For instance:

    Paint paint = new Paint();      
    paint.setColor(Color.RED);
    paint.setStyle(Style.STROKE);
    paint.setAntiAlias(true);
    paint.setStrokeWidth(2);
    canvas.drawCircle((source.getWidth() - margin)/2, (source.getHeight() - margin)/2, radius-2, paint);
    

    Also, instead of using a drawRoundRect to draw a circle, you can use drawCircle

提交回复
热议问题