<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?android:attr/colorControlHighlight">
<item>
<shape>
<corners android:radius="3dp" />
<solid android:color="@color/white" />
</shape>
</item>
</ripple>
或者使用系统的
android:background="?selectableItemBackgroundBorderless"
android:background="?selectableItemBackgroundBorder"
RelativeLayout 需要设置
android:clickable = true