I have drawn a rectangle with canvas and I wonder if there is any property or way of giving a small shadow.
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
Paint pincel1 = new Paint();
pincel1.setColor(Color.rgb(151, 217, 69));
RectF rectangle = new RectF(30, 20,200,100);
canvas.drawRoundRect (rectangle, 6, 6, pincel1);
}
Thanks
This question contained the following code :
So customize it a bit to your needs and that will do the trick.
In your case just add
pincel1.setShadowLayer(10.0f, 0.0f, 2.0f, 0xFF000000);to your code.