如何在android中减少radiogroup中单选按钮之间的空间?

如何在android中减少radiogroup中单选按钮之间的空间?,android,radio-button,space,reduce,radio-group,Android,Radio Button,Space,Reduce,Radio Group,在我的应用程序中,我有一个对话框,其中包含一个带有四个单选按钮的radiogroup。我的问题是,它在emulator中看起来不错,但当我在phone中安装并运行我的应用程序时,单选按钮在它们之间获得了更多的空间。这使radiogroup在我的对话框之外拉伸。 请帮我做这个。 多谢各位 <RadioGroup android:id="@+id/radio_RemindAtDlg" android:layout_width="wrap_content"

在我的应用程序中,我有一个对话框,其中包含一个带有四个单选按钮的radiogroup。我的问题是,它在emulator中看起来不错,但当我在phone中安装并运行我的应用程序时,单选按钮在它们之间获得了更多的空间。这使radiogroup在我的对话框之外拉伸。 请帮我做这个。 多谢各位

<RadioGroup
        android:id="@+id/radio_RemindAtDlg"
        android:layout_width="wrap_content"
        android:layout_height="130dp"
        android:layout_marginTop="110dp"
        android:layout_marginLeft="20dp" >

        <RadioButton
            android:id="@+id/radio_OnceDlg"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Once"
            android:button="@drawable/radio_button"
            android:textSize="12dp" />

        <RadioButton
            android:id="@+id/radio_WeekDlg"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Every Week"
            android:button="@drawable/radio_button"
            android:textSize="12dp" />

        <RadioButton
            android:id="@+id/radio_MonthDlg"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Every Month"
            android:button="@drawable/radio_button"
            android:textSize="12dp" />

        <RadioButton
            android:id="@+id/radio_YearDlg"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Every Year"
            android:button="@drawable/radio_button"
            android:textSize="12dp" />

    </RadioGroup>


没有代码很难说,但我猜您将xml高度属性设置为
fill\u parent
,而不是
wrap\u content
使用您自己的大小、形状和组件之间的空间定义您自己的单选按钮:

另一个例子


我们可以看到您代码的相关部分吗?我有我的radiogroup代码。您将高度设置为固定大小,将其更改为包裹内容