我有以下布局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