我有以下佈局xml。我想把TextView放在左邊,Radiobutton放在右邊。我怎樣才能做到這一點?如何使用此代碼將TextView放到左側,並將Radiobutton放到右側?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/txtVehName"
android:hint="@string/VEH_NAME"
android:textSize="18sp"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</TextView>
<RadioButton
android:id="@+id/rbDefault"
android:text=""
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</RadioButton>
</LinearLayout>
感謝
帕特里克
對不起,該XML並沒有正確發佈,我會嘗試修復.. .FIXED – bugzy 2010-01-19 19:25:08
嘗試使用android:layout_width =「wrap_content」作爲textview。 – keyboardP 2010-01-19 19:29:39
不行。單選按鈕仍然位於textview旁邊。它同樣使用fill_parent也是 – bugzy 2010-01-19 19:44:12