title: Creating a linearlayout with weights
body: <p>Im trying to make something similar to this - <a href="https://stackoverflow.com/questions/13620991/android-layoutuser-interface">Android Layout(User Interface)</a> only I want to make the first column with a weight of 4 the second one with a weight of 2 (and also with two rows) and the last one with a weight of 1 (and also with three rows)...problem is It messes up itself (I copy and pasted the answer and changed everything according to my needs but it keeps on get messed up.. =) any help?
  [code]</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:background="@color/background_color"
      android:orientation="vertical"
  
      &lt;LinearLayout
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_weight="4"
          android:gravity="center_horizontal|center_vertical"
          android:orientation="horizontal" &gt;
  
          &lt;TextView
              android:id="@+id/textDishes"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginLeft="20dp"
              android:text="@string/dishes"
              android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
          &lt;ImageView
              android:id="@+id/imageDishes"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:src="@drawable/ic_launcher" /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;View
          android:layout_width="fill_parent"
          android:layout_height="@dimen/seperator_size"
          android:background="@color/seperator" /&gt;
  
      &lt;LinearLayout
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_weight="2"
          android:measureWithLargestChild="true"
          android:orientation="horizontal"
          android:weightSum="2" &gt;
  
          &lt;LinearLayout
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_weight="1"
              android:gravity="center_horizontal"
              android:orientation="vertical" &gt;
  
              &lt;TextView
                  android:id="@+id/textfood"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="@string/food"
                  android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
              &lt;ImageView
                  android:id="@+id/imagefood"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:src="@drawable/ic_launcher" /&gt;
          &lt;/LinearLayout&gt;
  
          &lt;View
              android:layout_width="fill_parent"
              android:layout_height="@dimen/seperator_size"
              android:background="@color/seperator" /&gt;
  
          &lt;LinearLayout
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_weight="1"
              android:gravity="center_horizontal"
              android:orientation="vertical" &gt;
  
              &lt;TextView
                  android:id="@+id/textMalls"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="@string/malls"
                  android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
              &lt;ImageView
                  android:id="@+id/imageMalls"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:src="@drawable/ic_launcher" /&gt;
          &lt;/LinearLayout&gt;
      &lt;/LinearLayout&gt;
  
      &lt;View
          android:layout_width="fill_parent"
          android:layout_height="@dimen/seperator_size"
          android:background="@color/seperator" /&gt;
  
      &lt;LinearLayout
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:weightSum="3"
          android:orientation="horizontal" &gt;
  
          &lt;LinearLayout
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_weight="1"
              android:gravity="center_horizontal"
              android:orientation="vertical" &gt;
  
              &lt;TextView
                  android:id="@+id/textView1"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="@string/app_name"
                  android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
              &lt;ImageView
                  android:id="@+id/imageView1"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:src="@drawable/ic_launcher" /&gt;
          &lt;/LinearLayout&gt;
  
          &lt;View
              android:layout_width="fill_parent"
              android:layout_height="@dimen/seperator_size"
              android:background="@color/seperator" /&gt;
  
          &lt;LinearLayout
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_weight="1"
              android:gravity="center_horizontal"
              android:orientation="vertical" &gt;
  
              &lt;TextView
                  android:id="@+id/textView2"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="@string/coupons"
                  android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
              &lt;ImageView
                  android:id="@+id/imageView2"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:src="@drawable/ic_launcher" /&gt;
          &lt;/LinearLayout&gt;
  
           &lt;View
              android:layout_width="fill_parent"
              android:layout_height="@dimen/seperator_size"
              android:background="@color/seperator" /&gt;
  
          &lt;LinearLayout
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_weight="1"
              android:gravity="center_horizontal"
              android:orientation="vertical" &gt;
  
              &lt;TextView
                  android:id="@+id/textView3"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="@string/markets"
                  android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
              &lt;ImageView
                  android:id="@+id/imageView3"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:src="@drawable/ic_launcher" /&gt;
          &lt;/LinearLayout&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  [/code]
  </code></pre>
  
  <p>That is the result - </p>
  
  <p><img src="https://i.stack.imgur.com/P4hhA.jpg" alt="enter image description here"></p>
  
  <p>The result should look like - 
  <img src="https://i.stack.imgur.com/jYzoR.jpg" alt="enter image description here">
  Any help??</p>