How to implement shadow in Android?-ThrowExceptions

Exception or error:

My UX designer has provided me with an elegant design and exported it as an Xd file. For shadows of some elements, Xd gives me below information:

Shadow color: #101F400D
X: 0dp
Y: 3dp 
Blur: 10dp

How can I create this layout in android with the above information?

Note: elevation is not what I want!

this is what i want to code

How to solve:

You can use cardView or Material design cardview to get the shadow effect

If you want to follow the guideline of material design you have to implement dependency

implementation ''

You can use material cardview as shown below



You have to use a nine patch image to achieve this. Create a nine patch image using any tool like this –

Then, set this image as background to your view.

Leave a Reply

Your email address will not be published. Required fields are marked *