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);