title: Android Studio Layout: Trying to make button 50% width and 50% height, with button in center
body: <p>I am working in Android Studio and want my layout to be a 2 by 2 grid of buttons with a button in the center.  See code below.</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:id="@+id/incentivebutton"&gt;
  
  &lt;Button
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Incentive"
      android:id="@+id/incentiveButton"
      android:onClick="IncentiveButton"
      android:layout_centerVertical="true"
      android:layout_centerHorizontal="true"
      android:nestedScrollingEnabled="true"
      android:background = "@drawable/roundbutton"
      android:paddingLeft="30dp"
      android:paddingRight="30dp"
      android:paddingTop="55dp"
      android:paddingBottom="55dp"
      android:layout_gravity="center_vertical" /&gt;
  
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/linearLayout1"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:padding="6dp"
      android:weightSum="2"
      android:orientation="vertical"&gt;
      &lt;LinearLayout
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_weight="1"&gt;
          &lt;Button
              android:id="@+id/buttonCollect"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:paddingLeft="8dp"
              android:paddingRight="8dp"
              android:layout_weight="1"/&gt;
  
          &lt;Button
              android:id="@+id/buttonCollect1"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:paddingLeft="8dp"
              android:paddingRight="8dp"
              android:layout_weight="1" /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_gravity="bottom"
          android:layout_weight="1"&gt;
          &lt;Button
              android:id="@+id/buttonCollect3"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:paddingLeft="8dp"
              android:paddingRight="8dp"
              android:layout_weight="1" /&gt;
  
          &lt;Button
              android:id="@+id/buttonCollect2"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:paddingLeft="8dp"
              android:paddingRight="8dp"
              android:layout_weight="1" /&gt;
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>This is what it looks like right now:</p>
  
  <p><a href="http://i.stack.imgur.com/LeAEh.png" rel="nofollow">enter image description here</a></p>
  
  <p>I like this layout, but I want the buttons to be 50% the height.  Does anyone have any suggestions?</p>