雖然已選中this Q&A,但文本無法左對齊到Android中的RadioGroup。如何在Android中將文本左對齊到RadioGroup?
當前成果
預期結果
代碼
C:\工作空間ADT \的Helloworld \ RES \佈局\ activity_main.xml中
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.helloworld.MainActivity" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:text="@string/fractions" />
<RadioGroup
android:id="@+id/fractions"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<RadioButton
android:id="@+id/fraction_true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:paddingRight="15dip"
android:text="@string/fraction_true" />
<RadioButton
android:id="@+id/fraction_false"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="15dip"
android:text="@string/fraction_false" />
</RadioGroup>
</RelativeLayout>
C:\工作空間ADT \的Helloworld \ RES \值\的strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Helloworld</string>
<string name="fractions">Fractions</string>
<string name="action_settings">Settings</string>
<string name="fraction_true">True</string>
<string name="fraction_false">False</string>
</resources>