How to show shadow in toolbar below API 21

Updated 22 December 2016

Save

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.

 

 

author
. . .

Leave a Comment

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


6 comments

  • Nara
    • Aman Gupta
  • Ricardo
    • Aman Gupta (Moderator)
  • Bhola Nath Mahto
    • Aman Gupta (Moderator)
  • Start a Project


      Message Sent!

      If you have more details or questions, you can reply to the received confirmation email.

      Back to Home