Possible Duplicate:
How do you set a line's width when drawing in Android?
I've seen How to draw a line in android but how can I set line width? I tried to set Paint
colorCenter = new Paint();
colorCenter.setAntiAlias(true);
colorCenter.setStrokeWidth(100);
colorCenter.setColor(0xFF00FFFF);
then in onDraw()
canvas.drawLine(0, 0, 40, 40, colorCenter);
开发者_如何学JAVA
but it always 1px.
I also tried to find class LineShape
and use it with ShapeDrawable
, but there is no such class!
Add..
colorCenter.setStyle(Paint.Style.STROKE);
get the Canvas and use drawLine(startX, startY, stopX, stopY, paint)
精彩评论