円弧を描くと、影のレイヤーが描かれないという問題があります。ここに私のPaint
オブジェクトがあります:
circlePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
circlePaint.setStrokeWidth(strokeWidth);
circlePaint.setColor(Color.WHITE);
circlePaint.setStyle(Paint.Style.STROKE);
circlePaint.setShadowLayer(shadowRadius, 0, shadowOffset, 0xFF000000);
とでonDraw()
:
canvas.drawArc(rect, 0, 180, false, circlePaint);
shadowLayer が無視されているような気がします。楕円の周りにドロップ シャドウを描画する他の方法はありますか? 問題は、楕円形の get のサイズが変更される (高さが大きくなるなど) ことです。そのため、ninepatch だけを使用することはできません。