Paint.Style.FILL设置只绘制图形内容
Paint.Style.STROKE设置只绘制图形的边
Paint.Style.FILL_AND_STROKE设置都绘制
代码如下:
mPaint = new Paint();
mPaint.setStrokeWidth(mWidth);
mPaint.setColor(mColor);
mPaint.setAntiAlias(true);
mPaint.setDither(true);
mPaint.setStyle(Paint.Style.FILL);
canvas.drawCircle(400, 810, 200, mPaint);
mPaint.setStyle(Paint.Style.STROKE);
canvas.drawCircle(400, 400, 200, mPaint);
mPaint.setStyle(Paint.Style.FILL_AND_STROKE);
canvas.drawCircle(400,1210,200,mPaint);
效果图: