如何设置波纹效果

How to set the Ripple effect

我正在开发一个 minSdkVersion = 16 的应用程序,我需要在 Lollipop 及更高版本中使用涟漪效果,并在较低版本中使用其他一些效果。
有什么方法可以使用 XML?

您可以在 pre lollipop 设备上使用 Material 设计。 您需要在 gradle 中添加此 :

compile 'com.android.support:appcompat-v7:23.2.1'

阅读 Google 博客上的参考资料 link

您可以为 pre-Lollipop 和 Lollipop 或更高版本创建不同的 XML 文件

不需要为特定版本设计任何其他布局只需使用这个库来产生涟漪效果

https://github.com/traex/RippleEffect

此库的编译行

dependencies {
compile 'com.github.traex.rippleeffect:library:1.3'

}