下の画像のようにコントロールを配置する方法。
私はすでに以下のxmlコードで試しましたが、
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tableLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dip" >
<TextView
android:id="@+id/textView1"
android:text="Device Status"
android:textAppearance="?android:attr/textAppearanceLarge" />
<ToggleButton
android:id="@+id/toggleButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_column="2"
android:textOff="Device Off"
android:textOn="Device On" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dip" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:text="Save"
android:onClick="onSaveButtonClick"
/>
</TableRow>
</TableLayout>
しかし、私はこのような結果を得ました(デバイスのステータスとオン/オフの間にギャップが必要です)
事前の感謝