I'm doing a project in android studio and I want to use the property elevation
for some LinearLayout
but since the app will also be directed to lower versions of the api 20
I'm doing a project in android studio and I want to use the property elevation
for some LinearLayout
but since the app will also be directed to lower versions of the api 20
To do this you have to simulate the elevation:
You can define as
background
your view thisShape
:This would be the file
my_background.xml
that is created inside the folder/drawable
:Another known method is to add the
dialog_holo_light_frame
SDK drawable as a background:With both options you can get something similar to the property
elevation
:As a third option is to create a Drawable 9 patch whose image contains the elevation shadow and which you would use as the background of your view:
https://stackoverflow.com/questions/21211870/android-view-shadow/25683148#25683148