0%

Canvas 绘制阴影

使用PaintsetShadowLayer方法

//If radius is 0, then the shadow layer is removed.
public void setShadowLayer(float radius, float dx, float dy, int shadowColor);

注意:该方法不支持硬件加速,所以使用前需要调用View.setLayerType(LAYER_TYPE_SOFTWARE, null);才会有效果