Android 自定义无线电组
我正在尝试使用radio小部件进行小组活动。我的问题是,我似乎无法删除单选按钮附带的扬声器图标。任何帮助都将非常感谢Android 自定义无线电组,android,Android,我正在尝试使用radio小部件进行小组活动。我的问题是,我似乎无法删除单选按钮附带的扬声器图标。任何帮助都将非常感谢 如果需要自定义单选按钮外观 在drawable文件夹中创建选择器xml(radio_btn_selector.xml),如下所示 <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/pressed_im
如果需要自定义单选按钮外观 在drawable文件夹中创建选择器xml(radio_btn_selector.xml),如下所示
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/pressed_image"
android:state_pressed="true"/>
<item android:drawable="@drawable/checked_image"
android:state_checked="true"/>
<item android:drawable="@drawable/focused_image"
android:state_focused="true" />
<item android:drawable="@drawable/default_image" />
</selector>
现在在单选按钮中使用选择器作为按钮类型
<RadioButton
android:id="@+id/radioButton2"
android:layout_width="105dp"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="@null"
为什么不使用切换按钮呢?
没有图标的RadioButton类似于ToggleButton:)
<RadioButton
android:id="@+id/radioButton2"
android:layout_width="105dp"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="@null"