title: How to display 6 items in 2 rows horizontally equidistant in Android
body: <p>I'm writing a catalog app for Android tablet, which displays 6 item per page: 3 items for each row.
  Each item is composed by an image (200x300) and a text.
  Designing with android xml layout editor in Eclipse everything seems fine, because I'm using a default image for each item and a dummy fixed text: each item is horizontally perfectly equidistant there.</p>
  
  <p>When I run on tablet, each item is overwritten with an image taken from filesystem (200x300 again) and the text (variable length) is taken from database.
  The problem is taht after the 6 elements are populated with my custom data, the layout seems disaligned, as you can see from this screenshot: <img src="https://i.stack.imgur.com/9v756.png" alt="http://postimg.org/image/91mcv0z1f/"></p>
  
  <p>Probably (but I'm not sure) the problem is caused by the long text.
  Is there a way (if the problem is the text) to force the layout to remain fixed? (Or make the font small dinamically (or trunc the text, I don't care))</p>
  
  <p>This is the layout I'm using:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/RootView"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:background="@android:color/white"
  android:gravity="center_horizontal|center_vertical"
  android:orientation="vertical" &gt;
  
  &lt;LinearLayout
      android:id="@+id/filaTop"
      android:layout_width="fill_parent"
      android:layout_height="match_parent"
      android:layout_margin="15dp"
      android:layout_weight="1"
      android:gravity="center"
      android:orientation="horizontal" &gt;
  
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:layout_weight="1"
          android:orientation="vertical" &gt;
  
          &lt;ImageView
              android:id="@+id/ivBottle1"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_gravity="center"
              android:layout_weight="1"
              android:adjustViewBounds="true"
              android:src="@drawable/bottle_trans" /&gt;
  
          &lt;TextView
              android:id="@+id/tvBottle1"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:gravity="top|center"
              android:text="vino"
              android:textAlignment="center"
              android:textSize="22sp" &gt;
          &lt;/TextView&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:layout_weight="1"
          android:orientation="vertical" &gt;
  
          &lt;ImageView
              android:id="@+id/ivBottle2"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_gravity="center"
              android:layout_weight="1"
              android:adjustViewBounds="true"
              android:src="@drawable/bottle_trans" /&gt;
  
          &lt;TextView
              android:id="@+id/tvBottle2"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:gravity="top|center"
              android:text="vino"
              android:textAlignment="center"
              android:textSize="22sp" &gt;
          &lt;/TextView&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:layout_weight="1"
          android:orientation="vertical" &gt;
  
          &lt;ImageView
              android:id="@+id/ivBottle3"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_gravity="center"
              android:layout_weight="1"
              android:adjustViewBounds="true"
              android:src="@drawable/bottle_trans" /&gt;
  
          &lt;TextView
              android:id="@+id/tvBottle3"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:gravity="top|center"
              android:text="vino"
              android:textAlignment="center"
              android:textSize="22sp" &gt;
          &lt;/TextView&gt;
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  
  &lt;LinearLayout
      android:id="@+id/filaBottom"
      android:layout_width="fill_parent"
      android:layout_height="match_parent"
      android:layout_margin="15dp"
      android:layout_weight="1"
      android:gravity="center"
      android:orientation="horizontal" &gt;
  
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:layout_weight="1"
          android:orientation="vertical" &gt;
  
          &lt;ImageView
              android:id="@+id/ivBottle4"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_gravity="center"
              android:layout_weight="1"
              android:adjustViewBounds="true"
              android:src="@drawable/bottle_trans" /&gt;
  
          &lt;TextView
              android:id="@+id/tvBottle4"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:gravity="top|center"
              android:text="vino"
              android:textAlignment="center"
              android:textSize="22sp" &gt;
          &lt;/TextView&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:layout_weight="1"
          android:orientation="vertical" &gt;
  
          &lt;ImageView
              android:id="@+id/ivBottle5"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_gravity="center"
              android:layout_weight="1"
              android:adjustViewBounds="true"
              android:src="@drawable/bottle_trans" /&gt;
  
          &lt;TextView
              android:id="@+id/tvBottle5"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:gravity="top|center"
              android:text="vino"
              android:textAlignment="center"
              android:textSize="22sp" &gt;
          &lt;/TextView&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:layout_weight="1"
          android:orientation="vertical" &gt;
  
          &lt;ImageView
              android:id="@+id/ivBottle6"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_gravity="center"
              android:layout_weight="1"
              android:adjustViewBounds="true"
              android:src="@drawable/bottle_trans" /&gt;
  
          &lt;TextView
              android:id="@+id/tvBottle6"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:gravity="top|center"
              android:text="vino"
              android:textAlignment="center"
              android:textSize="22sp" &gt;
          &lt;/TextView&gt;
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>Thanks in advance.</p>
  
  <p><strong>EDIT (SOLVED):</strong> putting <code>android:layout_width="0dip"</code> in each linear layout, solved the problem as Dale Wilson suggested, like this:</p>
  
  <blockquote>
  <pre><code>    &lt;LinearLayout
          android:layout_width="0dip"
          android:layout_height="match_parent"
          android:layout_weight="1"
          android:orientation="vertical" &gt;
  </code></pre>
  </blockquote>