How to show shadow in toolbar below API 21

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.

 

 

. . .
Discuss on Helpdesk

Leave a Comment

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


6 comments

  • Nara
    Thanks. After every site i searched for, it’s the first site that really works!
    • Aman Gupta
      Your most welcome @disqus_mWMUto60IT:disqus . We always try to write very needful blogs for all android/ios developers.
  • Ricardo
    Thank you, its help me
    • Aman Gupta (Moderator)
      Your most welcome @Ricardo.
  • Bhola Nath Mahto
    Thanks it works
    • Aman Gupta (Moderator)
      Your most welcome.
  • css.php
    Start a Project


      Message Sent!

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

      Back to Home