android5.x view has one more attribute Z, the change in the vertical height.
The z attribute consists of two parts, elevation and Translationz
<imageview
android:id= "@+id/me_daijjback"
android:layout_width= "27DP"
android:layout_height= " 27DP "
android:elevation=" 3DP "
android:translationz=" 5DP "
The relationship between the two
Both Z=elevation and Translationz can be implemented in both XML and code.
if (Build.VERSION.SDK_INT >= build.version_codes. Lollipop) {
btn.setelevation (3f);
}
if (Build.VERSION.SDK_INT >= build.version_codes. Lollipop) {
Btn.settranslationz (5f);
}
The above is a small set to introduce the shadow effect of the android5.x in the elevation and Translationz to achieve the method, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!