如何在Android中对齐单选按钮

嗨,

我正在尝试在我的android应用程序中使用单选组/单选按钮的以下示例.
http://www.androidpeople.com/android-radiobutton-example/

但是单选按钮位于标签(文本)的左侧.

您能告诉我如何配置它,以便单选按钮位于标签的右侧吗?文本与父对象左对齐,单选按钮与父对象右对齐?

谢谢.

最佳答案
右侧对齐单选按钮:

<RadioButton
                    android:id="@+id/radio0"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:background="@null"
                    android:button="@null"
                    android:checked="true"
                    android:drawableRight="@drawable/presets_sel"
                    android:padding="12dp"
                    android:text="RadioButton 1" />
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:drawable="@drawable/right_arrow_h" android:state_checked="true"/>
    <item android:drawable="@drawable/right_arrow_h" android:state_pressed="true"/>
    <item android:drawable="@drawable/right_arrow"></item>

</selector>

以上是来客网为你收集整理的如何在Android中对齐单选按钮 全部内容,希望文章能够帮你解决如何在Android中对齐单选按钮 所遇到的程序开发问题。

如果觉得来客网网站内容还不错,欢迎将来客网网站推荐给程序员好友。