Search code examples
androidmaterial-designshadow

How to create a shadow for a layout or ImageView?


i am trying to coding the below image for android app design, i can not get shadow as same as image how i can do it perfectly? and can control with opacity, degree and color of shadow?

enter image description here


Solution

  • You can use cardView which has an elevation attribute which gives shadows to your card view.

    also there are third party libraries which you can use like this:

    https://github.com/loopeer/shadow

    also here is Google documentation which describes how you should use shadows in your ui:

    https://developer.android.com/training/material/shadows-clipping