How to implement the Material-design Elevation for Pre-lollipop

前端 未结 7 1490
南旧
南旧 2020-11-27 11:44

Google has shown some nice ways that elevation effect are shown on Lollipop here.

android:elevation=\"2dp\"

for buttons,

an         


        
7条回答
  •  醉酒成梦
    2020-11-27 12:40

    Create a 9-patch image with stretchable patches defined on an image with shadow around it.

    enter image description here

    Add this 9-patch image as a background of your button with a padding so that the shadow is visible.

    You can find some pre-defined 9-patch (.9.png) images here or here from where you can select, customize and copy to your project's drawable.

提交回复
热议问题