我使用下面的代码来绘制视图
@Override
protected synchronized void onDraw(Canvas canvas) {
super.onDraw(canvas);
paint.setStyle(Style.STROKE);
paint.setAntiAlias(true);
RectF rectF = new RectF(0,0,30,30);
RectF rectF1 = new RectF(200,0,230,30);
canvas.drawArc(rectF, 270, 180, false, paint);
canvas.drawArc(rectF1, 90, 180, false, paint);
canvas.drawLine(15, 0, 215, 0, paint);
canvas.drawLine(15, 30, 215,30, paint);
}
输出如下
但我想填充视图内的颜色。
如何做到这一点?