Using Material Design Shadow
____________________________
Shometimes you try to use shadow in your apps but it doesn't work
To Note The Following:
1-It works only on android 5 or above
2-Set background non transparent color for Parent layout even #FFF
3-Set background non transparent color for Child layout even #FFF
4-Add these attributes to Child Layout»
android:translationZ="2dp"
android:elevation="2dp"
Care about that when you have More than 2 elements don't use same translationZ becuase 2objects that have same translationZ wont make shadow
the formula for real object height : translationZ + elevation
You can read more :
https://material.google.com/what-is-material/elevation-shadows.html
https://developer.android.com/training/material/shadows-clipping.html
____________________________
Shometimes you try to use shadow in your apps but it doesn't work
To Note The Following:
1-It works only on android 5 or above
2-Set background non transparent color for Parent layout even #FFF
3-Set background non transparent color for Child layout even #FFF
4-Add these attributes to Child Layout»
android:translationZ="2dp"
android:elevation="2dp"
Care about that when you have More than 2 elements don't use same translationZ becuase 2objects that have same translationZ wont make shadow
the formula for real object height : translationZ + elevation
You can read more :
https://material.google.com/what-is-material/elevation-shadows.html
https://developer.android.com/training/material/shadows-clipping.html
Material Design
Build beautiful, usable products faster. Material Design is an adaptable system—backed by open-source code—that helps teams build high quality digital experiences.