Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You should insert a LinearLayout (or any other layout) as a row cell containing other elements. </p> <p>The example code generates a TableLayout containing two TableRows, each containing three elements (as defined by the weightSum property). I used LinearLayouts as child elements (column cells) with vertical orientation, so the elements are positioned properly.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" &gt; &lt;TableRow android:weightSum="3" android:layout_width="fill_parent" android:layout_height="wrap_content" &gt; &lt;LinearLayout android:layout_weight="1" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" &gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="I AM AN ICON" /&gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="APP NAME" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_weight="1" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" &gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="I AM AN ICON" /&gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="APP NAME" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_weight="1" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" &gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="I AM AN ICON" /&gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="APP NAME" /&gt; &lt;/LinearLayout&gt; &lt;/TableRow&gt; &lt;TableRow android:weightSum="3" android:layout_width="fill_parent" android:layout_height="wrap_content" &gt; &lt;LinearLayout android:layout_weight="1" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" &gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="I AM AN ICON" /&gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="APP NAME" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_weight="1" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" &gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="I AM AN ICON" /&gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="APP NAME" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_weight="1" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" &gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="I AM AN ICON" /&gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="APP NAME" /&gt; &lt;/LinearLayout&gt; &lt;/TableRow&gt; &lt;/TableLayout&gt; </code></pre> <p>And, as ryandlf pointed out, <strong>avoid using static dimensions</strong> if possible.</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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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