Possible Duplicate:
How do you set a line's width when drawing in Android?




我看过How to draw a line in android,但如何设置线宽?我试图设置绘画

    colorCenter = new Paint();
    colorCenter.setAntiAlias(true);
    colorCenter.setStrokeWidth(100);
    colorCenter.setColor(0xFF00FFFF);


然后在onDraw()

canvas.drawLine(0, 0, 40, 40, colorCenter);


但始终为1px。

我也尝试找到类LineShape并与ShapeDrawable一起使用,但是没有这样的类!

最佳答案

加..

  colorCenter.setStyle(Paint.Style.STROKE);

07-28 12:32