title: How to set an Android GridView with different column sizes
body: <p>I have a GridView in my main layout as follows:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" &gt;
  
      &lt;GridView
          xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/gridview"
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:layout_weight="1"
          android:gravity="center"
          android:horizontalSpacing="1dp"
          android:stretchMode="columnWidth"
          android:verticalSpacing="1dp" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>which produces a grid like this
  <img src="https://i.stack.imgur.com/fvCQB.png" alt="enter image description here"></p>
  
  <p>the contents of each cell is a layout like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="wrap_content"
      android:layout_height="match_parent"
      android:background="@drawable/btn_measurement" &gt;
  
      &lt;Button
          android:id="@+id/numerical"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:text="---" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>But I want the 4th column to be one-third of other columns and I just can't.</p>
  
  <p>I checked the links:</p>
  
  <p><a href="https://stackoverflow.com/questions/6651175/gridview-with-different-column-sizes?answertab=active#tab-top">GridView with different column sizes</a> and <a href="https://stackoverflow.com/questions/8873488/android-gridview-column-stretching">Android GridView Column Stretching</a></p>
  
  <p>but they were of no help. :(</p>
  
  <p>if you think that I need to change my solution entirely please be more precise than just giving a general clue.
  Thanx</p>