【发布时间】:2013-10-21 13:49:03
【问题描述】:
我想在画布上画两个彩色圆圈。一切都是正确的,但圈子并不顺畅。 效果如下:
这是代码:
private void drawCircle(Canvas c)
{
RectF oval = new RectF(20, 20, 100, 100);
c.drawArc(oval, -90, 180, false, getPaintWithColor(R.color.background));
c.drawArc(oval, 90, 180, false, getPaintWithColor(R.color.font_grey));
}
private Paint getPaintWithColor(int colorId){
Paint paint = new Paint();
paint.setAntiAlias(true);
paint.setDither(true);
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(4);
paint.setColor(getResources().getColor(colorId));
return paint;
}
【问题讨论】:
标签: android surfaceview