Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid two buttons side by side into table row
    primarykey
    data
    text
    <p>I have a tablelayout with an image and two buttons. I need to put the two buttons in the same row and the same size. Now I could align the butons in the same row but it's shown in diferents size. The background define the image in the butons but not the size. I define the properties of image in the code. The code of tablelayout</p> <pre><code>&lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/tableLayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/black" &gt; &lt;TableRow android:id="@+id/tableRow1" android:layout_width="100dp" android:layout_height="100dp" android:gravity="center_horizontal" &gt; &lt;ImageView android:id="@+id/imagePreLoad" android:layout_width="wrap_content" android:layout_height="250dp" android:layout_marginTop="84dp" android:background="@drawable/lunafons" android:contentDescription="@string/app_name" /&gt; &lt;/TableRow&gt; &lt;TableRow android:id="@+id/tableRow2" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center_horizontal" android:layout_marginTop="50dp" android:layout_gravity="center_horizontal" android:background="@color/black" &gt; &lt;Button android:id="@+id/btnload" android:background="@drawable/btnback" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" /&gt; &lt;Button android:id="@+id/btnload" android:background="@drawable/btnloadwallpaper" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" /&gt; &lt;/TableRow&gt; &lt;/TableLayout&gt; </code></pre> <p>And the code of background butons:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;item android:state_enabled="false" android:drawable="@drawable/btnload1" /&gt; &lt;item android:state_enabled="true" android:state_pressed="true" android:drawable="@drawable/btnload2" /&gt; &lt;item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/btnload1" /&gt; &lt;item android:state_enabled="true" android:drawable="@drawable/btnload1" /&gt; </code></pre> <p></p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload