简体   繁体   English

如何设置涟漪效果

[英]How to set the Ripple effect

I am working on an app which has a minSdkVersion = 16, and I need to use the ripple effect in Lollipop and above and some other effect on lower version. 我正在开发一个minSdkVersion = 16的应用程序,我需要在Lollipop和更高版本中使用波纹效果,而在较低版本中使用其他效果。
Is there any way to do this using XML? 有什么办法可以使用XML做到这一点?

No need to design any other layout just for specific version just Use this library for ripple effect 无需仅针对特定版本设计任何其他布局,只需使用此库即可产生波纹效果

https://github.com/traex/RippleEffect https://github.com/traex/RippleEffect

compile line for this library 该库的编译行

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

} }

You can use Material Design on pre lollipop Devices. 您可以在预棒棒糖设备上使用Material Design。 You need to add in your gradle this : 您需要在gradle中添加以下内容:

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

Read the reference on Google blog link 阅读Google博客链接上的参考

You can create different XML files for pre-Lollipop and Lollipop or higher 您可以为之前的Lollipop和Lollipop或更高版本创建不同的XML文件 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM