Aspicas Aspicas - 5 months ago 50x
Java Question

Android: Navigation Drawer vertical shadow

I have implemented a

in my application. I would like to know how I can add a vertical shadow effect which is below the main Fragment, similar to the picture below.

enter image description here

I have one image on my drawable with the shadow image. It's called "drawer_shadow.9" but I don't know how I can implement this inside my


You will need to use a drawable for the shadow. Use the setDrawerShadow method on the navigationDrawer object. For example:

navigationDrawer.setDrawerShadow(R.drawable.someDrawable, GravityCompat.START);

Link to the official document: setDrawerShadow

Hope this helps