title: (Android) Why the spacing exist in my gridview?
body: <p>I am considering about the white blank spacing.</p>
  
  <p>I don't know the reason why white spacing exist in my gridview.</p>
  
  <p>I attached '.xml' and the 'result screen shot. '</p>
  
  <p>I am trying use the gravity things.. but It dosen't work.</p>
  
  <p>Could anyone help me??</p>
  
  <p>...I got stackoverflow error 'It looks like your position is mostly code...</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="match_parent"
      android:layout_height="match_parent"
      android:background="#fff"
      android:orientation="vertical"
      android:weightSum="1"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:layout_margin="10dp"
          android:layout_weight="0.2"&gt;
  
          &lt;TextView
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_gravity="center"
              android:background="@drawable/set_border"
              android:gravity="center"
              android:text="@string/msg_diary_plan"
              android:textStyle="bold" /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:layout_weight="0.53"
          android:orientation="vertical"
          android:weightSum="1"&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="0dp"
              android:layout_weight="0.15"
              android:orientation="horizontal"
              android:weightSum="1"&gt;
  
              &lt;Button
                  android:id="@+id/btn_backmonth"
                  android:layout_width="wrap_content"
                  android:layout_height="match_parent"
                  android:layout_weight="0.1"
                  android:background="@android:color/transparent"
                  android:text="" /&gt;
  
              &lt;TextView
                  android:id="@+id/tv_date"
                  android:layout_width="match_parent"
                  android:layout_height="30dp"
                  android:layout_gravity="center"
                  android:layout_weight="0.8"
                  android:background="@android:color/transparent"
                  android:gravity="center"
                  android:paddingLeft="10dp"
                  android:textColor="#000"
                  android:textSize="20sp" /&gt;
  
              &lt;Button
                  android:id="@+id/btn_nextmonth"
                  android:layout_width="wrap_content"
                  android:layout_height="match_parent"
                  android:layout_weight="0.1"
                  android:background="@android:color/transparent"
                  android:text="" /&gt;
          &lt;/LinearLayout&gt;
  
          &lt;GridView
              android:id="@+id/gridview"
              android:layout_width="match_parent"
              android:layout_height="0dp"
              android:layout_weight="0.85"
              android:listSelector="#ffff"
              android:numColumns="7" /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:id="@+id/layout_alarm"
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:layout_weight="0.17"
          android:orientation="horizontal"
          android:visibility="visible"
          android:weightSum="1"&gt;
  
          &lt;LinearLayout
              android:layout_width="0dp"
              android:layout_height="match_parent"
              android:layout_weight="0.3"
              android:orientation="vertical"
              android:weightSum="1"&gt;
  
              &lt;Switch
                  android:id="@+id/sw_alarm"
                  android:layout_width="match_parent"
                  android:layout_height="0dp"
                  android:layout_gravity="center"
                  android:layout_weight="1"
                  android:gravity="center"
                  android:text="Alarm" /&gt;
          &lt;/LinearLayout&gt;
  
          &lt;TimePicker
              android:id="@+id/timePicker"
              android:layout_width="0dp"
              android:layout_height="match_parent"
              android:layout_weight="0.7"
              android:timePickerMode="spinner" /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:layout_weight="0.1"&gt;
  
          &lt;Button
              android:id="@+id/btn_alarm_submit"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:background="#000"
              android:text="SUBMIT"
              android:textColor="@color/white" /&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>and the result is
  <a href="https://i.stack.imgur.com/cMGcD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cMGcD.png" alt="enter image description here"></a></p>
  
  <p>and this is the gridview item layout. Thanks</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="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
  android:weightSum="1"&gt;
  
  &lt;TextView
      android:id="@+id/tv_item_gridview"
      android:layout_width="wrap_content"
      android:layout_height="0dp"
      android:layout_weight="0.8"
      android:textColor="#000" /&gt;
  
  &lt;TextView
      android:id="@+id/isDone"
      android:layout_width="wrap_content"
      android:layout_height="0dp"
      android:layout_weight="0.2"
      android:visibility="visible" /&gt;
  </code></pre>
  
  <p></p>