从RadioButton,android删除涟漪效应?

Riy*_* PK 12 android

我自定义了一个RadioButton样式,用于在右侧添加radiobutton图像

<RadioButton
                android:layout_margin="20dp"
                android:drawableRight="@drawable/custom_btn_radio"
                android:button="@null"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="Invite Only"/> 
Run Code Online (Sandbox Code Playgroud)

custom_btn_radio.xml

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/check_box" android:state_checked="false"/>
    <item android:drawable="@drawable/close_btn" android:state_checked="true"/>
</selector>
Run Code Online (Sandbox Code Playgroud)

但是,radiobutton的涟漪效应也增大了.如何从RadioButton中消除涟漪效应?还有如何自定义涟漪效果?

先感谢您.

Riy*_* PK 35

使RadioButton背景变得透明

android:background="#ffffffff"
Run Code Online (Sandbox Code Playgroud)

要么

android:background="@android:color/transparent"
Run Code Online (Sandbox Code Playgroud)

  • `android:background ="@ null"`也应该有效. (8认同)