Skip to content Skip to sidebar Skip to footer

Draw A Circle Within Circle At A Distance Of 10

I have recently started working with Android, And I need to draw a Circle within Circle just like below image at a distance of 10. If you see the below photo, I need to draw someth

Solution 1:

Try:

protected void onDraw(Canvas canvas) {
            super.onDraw(canvas);
            Paint p = new Paint();
            p.setColor(Color.RED);
            DashPathEffect dashPath = new DashPathEffect(new float[]{5,5}, (float)1.0);

            p.setPathEffect(dashPath);
            p.setStyle(Style.STROKE);


            for (int i = 0; i < 7; i ++) {
                canvas.drawCircle(100, 100, 50+(i*10), p);
            }


            invalidate();
        }

Post a Comment for "Draw A Circle Within Circle At A Distance Of 10"