TableRow Column Resizes

I am trying to create a file XMLfor Android remote control. I usedTableLayout

As you can see in the screenshot, the column changes its size (but all images have the same size). The only problem is this line.

Here is a link to my code (I can’t put it here, since mine is XMLtoo big): https://codeshare.io/G6qDnk

enter image description here

+4
source share
1 answer
 <TableRow
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:gravity="center">

            <LinearLayout android:layout_height="wrap_content"
                android:layout_width="match_parent"
                android:orientation="vertical">
                <View
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:layout_weight="0.5"/>

                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="0dp"
                    android:layout_weight="1"
                    android:layout_gravity="center"
                    app:srcCompat="@mipmap/right" />
                <View
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:layout_weight="0.5"/>
            </LinearLayout>

        </TableRow>

try this table row code for the left button and the right button around the Ok button.

+1
source

Source: https://habr.com/ru/post/1690763/


All Articles