我有一個問題,當我畫一個弧時陰影層沒有被繪製。這裏是我的Paint
對象:帶有陰影的Android drawArc
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。
哦,是的,這是問題所在。謝謝! –