Skip to content Skip to sidebar Skip to footer

Android - Need Help For Ondraw() View Sample

i've used below code for draw a view @Override protected synchronized void onDraw(Canvas canvas) { super.onDraw(canvas); paint.setStyle(Style.STROKE); paint.setAntiAl

Solution 1:

use Path instead of calling four times drawLine/drawArc


Solution 2:

I've changed my ondraw code . Now its working.

Path path = new Path();
path.arcTo(rectF, 270, 180);
        path.lineTo(200,30 );
        path.arcTo(rectF1, 90, 180);
        path.close();
        canvas.drawPath(path, paint);

Solution 3:

paint.setStyle(Style.FILL);

Good luck.


Post a Comment for "Android - Need Help For Ondraw() View Sample"