0

同僚、そのような画面を取得するために ImageViews の属性に何を設定するようにアドバイスできますか?

ここに画像の説明を入力

私の驚異的な Android アプリケーションでのこのアクティビティの XML コード: 回避するためにここに投稿します。シナリオをより明確に説明してください。..... Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labe et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Exceptioneur sint occaecat cupidatat non proident, sunt in culpa qui office deserunt mollit anim id est labum.

            <TableRow
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="#D63B40"
                android:layout_weight="0.15"
                 >

                 <ImageView
                android:id="@+id/img1"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:src="@drawable/n"
                android:background="@null"
                />


                 <ImageView
                android:id="@+id/r1"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:src="@drawable/n"
                android:background="@null"
                />



            </TableRow>

            <TableRow
                android:id="@+id/tableRow2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="#88CB5B"
                android:layout_weight="0.14" >

                 <ImageView
                android:id="@+id/img2"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:src="@drawable/n"
                android:background="@null"
                />


                 <ImageView
                android:id="@+id/r2"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:src="@drawable/n"
                android:background="@null"
                />

            </TableRow>

            <TableRow
                android:id="@+id/tableRow3"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="#E8D751"
                android:layout_weight="0.14" >

                <ImageView
                android:id="@+id/3"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:src="@drawable/n"
                android:background="@null"
                />


                 <ImageView
                android:id="@+id/r3"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:src="@drawable/n"
                android:background="@null"
                />
            </TableRow>

            <TableRow
                android:id="@+id/tableRow4"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="#9554B6"
                android:layout_weight="0.14" >

            <ImageView
                android:id="@+id/4"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:src="@drawable/n"
                android:background="@null"
                />


                 <ImageView
                android:id="@+id/r4"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:src="@drawable/n"
                android:background="@null"
                />

            </TableRow>

    </TableLayout>

画像 1、2、3、4 および a、b、c、d は ImageView です。

4

1 に答える 1

0

リスト ビューを使用し、カスタムアダプターを使用して、 2 つの画像 (状態) をリストに追加できます。このリンクは、Uがアダプタを操作するのに役立ちます

于 2012-11-02T04:55:49.620 に答える