title: Grid view in xml android
body: <p>I want to display <code>ImageButtons</code> in <code>GridView</code>. Currently I am using <code>RelativeLayout</code>.</p>
  
  <p>Here is my XML code:</p>
  
  <pre><code>&lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/ScrollView01"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent" &gt;
  
  
      &lt;RelativeLayout
      android:id="@+id/RelativeLayout01"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="#ffffff"
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      tools:context="com.easy.convert.MainActivity" &gt;
  
      &lt;ImageButton
          android:id="@+id/btnbitsbytes"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentTop="true"
          android:layout_centerHorizontal="true"
          android:layout_marginTop="25dp"
          android:background="#00000000"
          android:gravity="center"
          android:src="@drawable/btnbitsbytes" /&gt;
  
      &lt;ImageButton
          android:id="@+id/btnmassweight"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@+id/btnbitsbytes"
          android:layout_below="@+id/btnbitsbytes"
          android:layout_marginTop="14dp"
          android:background="#00000000"
          android:src="@drawable/btnmassweight" /&gt;
  
      &lt;ImageButton
          android:id="@+id/ButtonConvert"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@+id/btnmassweight"
          android:layout_below="@+id/btnmassweight"
          android:layout_marginTop="14dp"
          android:background="#00000000"
          android:src="@drawable/btnlength" /&gt;
  
      &lt;ImageButton
          android:id="@+id/imageButton3"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@+id/ButtonConvert"
          android:layout_below="@+id/ButtonConvert"
          android:layout_marginTop="14dp"
          android:background="#00000000"
          android:src="@drawable/btntemperature" /&gt;
  
      &lt;ImageButton
          android:id="@+id/imageButton4"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@+id/imageButton3"
          android:layout_below="@+id/imageButton3"
          android:layout_marginTop="15dp"
          android:background="#00000000"
          android:src="@drawable/btndistance" /&gt;
  
      &lt;ImageButton
          android:id="@+id/imageButton5"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@+id/imageButton4"
          android:layout_centerHorizontal="true"
          android:layout_marginTop="22dp"
          android:background="#00000000"
          android:src="@drawable/btnaboutus" /&gt;
  
      &lt;/RelativeLayout&gt;
  &lt;/ScrollView&gt;
  </code></pre>
  
  <p>I dont know how to use GridView or any other Layout but i want my layout to look something like this:</p>
  
  <p><img src="https://i.stack.imgur.com/KcT20.png" alt="enter image description here"></p>