Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Updated answer for this layout. </p> <p>| Text | | TextText |</p> <p>I change the layout_height to wrap_content. Also added inside the TableRow. Personally I don't like TableLayout as it's unpredictable and troublesome, particularly when using merged columns, colspan. I prefer using LinearLayout with layout_weight for each row.</p> <pre><code> &lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:orientation="vertical" android:padding="10dp" &gt; &lt;TableLayout android:id="@+id/tableLayout1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/table_shape" &gt; &lt;TableRow android:layout_width="wrap_content" android:layout_height="fill_parent" android:background="@drawable/cell_shape3" android:padding="10dp" &gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:orientation="horizontal" &gt; &lt;View android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="0.375" /&gt; &lt;TextView android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="0.25" android:text="Text" /&gt; &lt;View android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="0.375" /&gt; &lt;/LinearLayout&gt; &lt;/TableRow&gt; &lt;TableRow android:layout_width="wrap_content" android:layout_height="fill_parent" android:background="@drawable/cell_shape3" android:padding="10dp" &gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:orientation="horizontal" &gt; &lt;View android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="0.375" /&gt; &lt;TextView android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="0.25" android:text="Text Text" /&gt; &lt;View android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="0.375" /&gt; &lt;/LinearLayout&gt; &lt;/TableRow&gt; &lt;/TableLayout&gt; &lt;/ScrollView&gt; </code></pre>
    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.
    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