1
我想使用画布在设备的中心绘制4个角边缘。如何绘制4角边缘设备的中心
像这样
我想这
Paint myPaint = new Paint();
myPaint.setColor(Color.GREEN);
myPaint.setStyle(Paint.Style.STROKE);
canvas.drawRect(
getLeft()+(getRight()-getLeft())/4,
getTop()+(getBottom()-getTop())/4,
getRight()-(getRight()-getLeft())/4,
getBottom()-(getBottom()-getTop())/3,myPaint);
我的结果
使用[drawPath](https://developer.android.com/reference/android/graphics/Canvas.html# drawPath(android.graphics.Path,android.graphics.Paint)而不是drawRect。 – Blackbelt
使用矢量Drawable for this .. http://stackoverflow.com/a/40217644/6893465 –
...或一个简单的9补丁 –