3

I am trying to make an XML file for Android remote control. I have used TableLayout

As you see from the screenshot the column changes its size (but all images have the same size). The problem is only with that row.

Here is the link to my code (can not put it here as my XML is too big): https://codeshare.io/G6qDnk

enter image description here

denvercoder9
  • 2,979
  • 3
  • 28
  • 41
abrutsze
  • 496
  • 1
  • 8
  • 24

1 Answers1

1
 <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 code of table row for the left button and right button around Ok button.

TysonSubba
  • 1,362
  • 2
  • 12
  • 16
  • Er.Tyson Subba, thanks for answer. You see the LEFT and RIGHT buttons now are smaller ( they have a size of UP/ DOWN buttons ), but the goal is to make them the same size as FORWARD button ( now they are a bit smaller ) – abrutsze Dec 14 '17 at 10:07
  • @abrutsze check the edited answer..if necessary do some tweaks with weight of view and you will get it as you are saying. – TysonSubba Dec 14 '17 at 10:30
  • Nothing changed :( – abrutsze Dec 14 '17 at 12:20
  • it is working on mine.. you might have missed something in your code. replace the images and check . – TysonSubba Dec 15 '17 at 04:51
  • Hmm, in my case it does not work, but however I'll put a like for your answer. Thanks for an answer. – abrutsze Dec 15 '17 at 05:46