2

私はAndroidアプリケーションを開発しています。1 つのアクティビティには、次のような TableLayout があります。

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/ereportfillscroller"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:fillViewport="true">

        <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <TableLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/EReportTableLayout"
            android:layout_margin="10dp"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:shrinkColumns="*"  
            android:stretchColumns="*">

            <TableRow>
                <TextView
                    android:id="@+id/txtGenInfo"
                    android:layout_span="8"
                    android:layout_gravity="center_horizontal"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/layout_title_general_information"
                    android:textAppearance="?android:attr/textAppearanceLarge" />
            </TableRow>
        <TableRow>
            <TextView
                android:id="@+id/txtPONo"
                android:layout_weight=".125"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:text="@string/layout_po_no"
                android:textAppearance="?android:attr/textAppearanceMedium" />
        </TableRow>

        <!-- MORE ROWS -->

    </TableLayout>
        <Button
            android:id="@+id/btnPhoto"
            android:onClick="onTakeAPhotoClick"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Take a photo" />

    </LinearLayout>
</ScrollView>

たとえば、1 行目と 2 行目の間に別の TableRow をプログラムで挿入する必要があります。どうすればそれを行うことができます=

4

2 に答える 2