只針對5.0及以上程序
預(yù)覽還能看,發(fā)布看不見了
android水波紋效果,效果如下圖:

效果圖
首先建一個(gè)shape,我們命名為test.xml在drawable里
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#8cc476" />
<corners android:radius="0dp" />
</shape>
然后我們再建一個(gè)ripple
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="#FF21272B">
<item android:drawable="@drawable/test" />
</ripple>
最后,我們只要給對應(yīng)的view設(shè)置background就可以了。
這里面有2個(gè)顏色,可自行配置。