Android 单选按钮自定义图像在棒棒糖下面未更改

Android 单选按钮自定义图像在棒棒糖下面未更改,android,Android,我有问题,单选按钮的自定义图像在棒棒糖下面不起作用: 首先,我创建如下样式 <style name="MyOwnRadioButton" parent="@android:style/Widget.CompoundButton.RadioButton"> <item name="android:button">@drawable/myoptionradio</item> </style> <!-- Base application

我有问题,单选按钮的自定义图像在棒棒糖下面不起作用:

首先,我创建如下样式

<style name="MyOwnRadioButton" parent="@android:style/Widget.CompoundButton.RadioButton">
    <item name="android:button">@drawable/myoptionradio</item>
</style>

<!-- Base application theme. -->
<style name="AppThemeCustom" parent="@style/Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <!--<item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>-->
    <item name="android:radioButtonStyle">@style/MyOwnRadioButton</item>
</style>

@可牵引/myoptionradio
@样式/单选按钮
这是我在drawable中的myoptionradio.xml

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_checked="false" android:drawable="@android:color/transparent" />
    <item android:state_checked="true" android:drawable="@drawable/abs__ic_cab_done_holo_light" />
</selector>

我的xml如下所示

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">

    <RadioGroup
        android:id="@+id/exp_body"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <RadioButton
            android:id="@+id/exp_body_friendly"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:checked="true"
            android:text="@string/exp_friendly_text" />

        <RadioButton
            android:id="@+id/exp_body_none"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/exp_none_text" />
    </RadioGroup>

</LinearLayout>

我在我的代码中什么也没做,所有这些都可以在棒棒糖和更高版本的设备中正常工作,并更改了单选按钮 在kitkat中显示图像但不工作,并在kitkat中显示默认单选按钮


提前感谢

只需删除
style/Widget.CompoundButton.RadioButton

   <RadioButton
         ............
          ...........
         style="@style/MyOwnRadioButton"/>
风格应该是这样的

 <style name="MyOwnRadioButton">
        <item name="android:button">@drawable/myoptionradio</item>
    </style>

您在哪里更改了自定义图像正如您所看到的,我在样式中声明了MyOwnRadioButton,它将myoptionradio作为可绘制的,并且在该myoptionradio中,我在android:state_checked=“true”的位置拍摄图像,然后设置style=“@style/MyOwnRadioButton”对于RadioButton,我已经设置了它,请查看我的样式xml文件,我在其中声明@style/MyOwnRadioButton,并且我在清单中设置了这些主题,只是给出了一个tryOk,它可以工作,但是如果我想在子选项菜单中进行此更改,在子菜单中我将子菜单分组为单选按钮,而我无法直接设置样式,该怎么办