Start a Project

How to show shadow in toolbar below API 21

In this blog,
I have shown you how to make a drop shadow in the toolbar below API 21.

Implementation

In this example, I have created a custom background XML(drop shadow) and applied it inside the FrameLayout.
And this will give a drop shadow effect on the toolbar.

toolbar.xml

 

 your_layout.xml

 

dropshadow.xml

Note: Don’t forget to hide your view if the device you are running is >= to Lollipop.

if not you’ll end up with two shadows.

 

 

Exit mobile version