我试图用画布画一个圆弧:
canvas.drawArc(getCircleRect(), 90, 270, true, PaintCreator.createStrokePaintForArc());
..但没有明显效果
从getCircleRect()得到的Rect的边界是正确的,我可以这样绘制矩形(仅用于测试):
canvas.drawRect(getCircleRect(), PaintCreator.createStrokePaintForArc());
任何想法为什么drawRect正在工作而drawArc没有? 感谢名单
@Override
public void onDraw(Canvas canvas) {
super.onDraw(canvas);
canvas.save();
// not working
canvas.drawArc(getCircleRect(), 90, 270, true, PaintCreator.createFillPaintArc());
// working well
canvas.drawRect(getCircleRect(), PaintCreator.createStrokePaintForArc());
// working well
canvas.drawCircle(x, y, RADIUS, fillPaint);
move = false;
canvas.restore();
}
答案 0 :(得分:0)
我不确定,但我认为你的绘画对象可能是问题所在。 试试这个
Paint mBgPaints = new Paint();
mBgPaints.setAntiAlias(true);
mBgPaints.setStyle(Paint.Style.FILL);
mBgPaints.setColor(Color.BLUE);
mBgPaints.setStrokeWidth(0.5f);
canvas.drawArc(getCircleRect(), 90, 270, true, mBgPaints);