0

I am using a toolbar with an elevation of 4dp. The shadow below the toolbar isn't generated on devices older than v21. I can, of course, approximate the shadow with custom drawable but where is the exact code or drawable (XML or 9-patch) in android SDK that produces shadow under toolbar on 21 and newer devices?

Abdul Karim
  • 4,359
  • 1
  • 40
  • 55
Mehmed
  • 2,880
  • 4
  • 41
  • 62

1 Answers1

0

Why do you need that file exactly?

You may just add shadow by putting it in the view with content that is under your toolbar.

@drawable/mShadow

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
   android:shape="rectangle">

<gradient android:startColor="@android:color/transparent"
          android:endColor="#88333333"
          android:angle="90"/>

</shape>