The use of Ripple ripple effect

New Ripple (ripple effect) after Android 5.0:

1.ripple_effect.xml

<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
    android:color="#FF0000" >
    
</ripple>

How to use:
android:background="@drawable/ripple_effect"

2. Add properties directly where the control is used:

android:background="?android:attr/selectableItemBackground"


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324735873&siteId=291194637