When trying to draw using the paths (path) on the Canvas square, or several squares, they are not drawn. However, if you draw a circle using paths, it is drawn freely. How can I draw a square using paths?
Path path = new Path(); Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); path.addRect(100, 200, 100, 50, Path.Direction.CW); paint.setStyle(Paint.Style.STROKE); paint.setStrokeWidth(5); paint.setColor(Color.GREEN); canvas.drawPath(path, paint);
addRect
method arguments mean - your left and right sides are the same, and the top is lower than the bottom. - woesss