Android アプリケーションのレイアウトを設計しています。これがレイアウトの骨組みです。
私が試したのは、GUI をテーブルの行と列に分割できるため、テーブル レイアウトを使用することです。基本的に、ご覧のようにレイアウトを 2 列に分割したかったのです。ここに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" >
<!-- 2 columns -->
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dip" >
<View
android:id="@+id/view1"
android:layout_weight="7"
android:layout_width="0dp"
android:layout_height="wrap_content">
<TextView
android:id="@+id/textView1"
android:text="Column 1"
android:textAppearance="?android:attr/textAppearanceLarge" />
</View>
<View
android:id="@+id/view2"
android:layout_weight="3"
android:layout_width="0dp"
android:layout_height="wrap_content" >
<Button
android:id="@+id/button1"
android:text="Column 2" />
</View>
</TableRow>
</TableLayout>
GUIで次のエラーが表示されます
Exception raised during rendering: android.view.View cannot be cast to android.view.ViewGroup
これは、ビューをグループ化できないと言っていると思います。それができない場合、これをどのように処理するか。私はウェブのバックグラウンドから来ました。View を html のように div として使用できると考えました。