从Android的RadioButton移除涟漪效应? [英] Remove ripple effect from RadioButton, android?

查看:56
本文介绍了从Android的RadioButton移除涟漪效应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已自定义样式的单选按钮,用于在右侧添加单选按钮图像

I have custom styled a RadioButton for adding radiobutton image on the right side

<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"/> 

custom_btn_radio.xml

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>

但是,单选按钮的涟漪效应也扩大了.如何从RadioButton消除波纹效果?以及如何自定义涟漪效应?

but, the radiobutton's ripple effect also enlarged. how can i remove ripple effect from RadioButton? and also how to customize ripple effect?

先谢谢您.

推荐答案

使RadioButton背景透明化

Make RadioButton background to transparent

android:background="#ffffffff"

android:background="@android:color/transparent"

这篇关于从Android的RadioButton移除涟漪效应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆