0
votes

Colleagues, what can you advise me to set into ImageViews' attributes to get such screen?

enter image description here

XML code for this Activity in my tremendous Android application: I post it here to avoid Your post does not have much context to explain the code sections; please explain your scenario more clearly...... Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore 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. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

            <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>

Image 1, 2, 3, 4 and a, b, c, d are ImageViews.

1
Why not just use a custom ListView? I'm just curiousJade Byfield
i guess u shld use List view.Terril Thomas
@ErrorHandler ok then how to make each item equal height and all of them together to fit 1 screen?Ivan Fazaniuk

1 Answers

0
votes

Use a list view then using a Custom Adapter u can add two images(in ur condition)to the list . This link will help U to work with the Adapter