2
プログラムでXMLで定義されたテーブルに行を追加しようとしています(この行には内部テーブルがあります)。テーブルレイアウトの行にプログラムでサブテーブルが追加されました
<TableLayout android:id="@+id/maintable"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:stretchColumns="*" xmlns:android="http://schemas.android.com/apk/res/android">
<TableRow android:id="@+id/tabrow">
<TableLayout android:id="@+id/tableLayout1"
android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<TableRow>
<TextView android:id="@+id/titlerow" android:layout_height="fill_parent" android:text="Hello world"
android:gravity="center" android:layout_width="fill_parent"
android:layout_weight="1" android:textSize="17sp"></TextView>
</TableRow>
<TableRow>
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_weight="1">
<TextView android:text="@string/time1" android:id="@+id/time1" style="@style/timeview"></TextView>
<TextView android:text="@string/time2" style="@style/dayview"></TextView>
<TextView android:text="@string/time3" style="@style/dayview"></TextView>
</LinearLayout>
</TableRow>
</TableLayout>
</TableRow>
ここでは、テーブルにこの(タブロー)行を何度も追加したいと考えています。
どうすればいいですか?このような
あなたはからの私の質問を参照することもできます前に長い時間: http://stackoverflow.com/questions/5342121/inflate-a-view-layout-into-another-layout –
@kevin I疲れたあなたの方法をやって ビューmenuLayout = inflater1.inflate(R .id.timealarm、mainLayout、true);この行はエラーを出しています – Arjit