title: Android - GridView not scrolling
body: <p>I am just a beginner in android, and wish to have your suggestions at places where i could improve my code.</p>
  <p>For our project we created a grid view, which loads users at runtime, now the issue with this is it doesnot scroll at times and is very hard to do so.</p>
  <p>Also we have used this grid view, making the view visible and gone depending upon the circumstances required by the app.</p>
  <p>Here's my xml file:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  
  &lt;ScrollView xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
  android:layout_width=&quot;wrap_content&quot;
  android:layout_height=&quot;wrap_content&quot; &gt;
  
  &lt;RelativeLayout
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;wrap_content&quot; &gt;
  
      &lt;!-- Title Layout --&gt;
  
      &lt;RelativeLayout
          android:id=&quot;@+id/newGroupTitleLayout&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;50dip&quot;
          android:background=&quot;@drawable/topbar_bg&quot; &gt;
  
          &lt;ImageButton
              android:id=&quot;@+id/newGroupCancelButton&quot;
              android:layout_width=&quot;60dip&quot;
              android:layout_height=&quot;30dip&quot;
              android:layout_alignParentLeft=&quot;true&quot;
              android:layout_centerVertical=&quot;true&quot;
              android:layout_marginLeft=&quot;5dp&quot;
              android:background=&quot;@drawable/buttonanim_cancel_button&quot;
              android:contentDescription=&quot;@string/todo&quot; /&gt;
  
          &lt;TextView
              android:id=&quot;@+id/setupPrefTitleTextView&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:layout_centerHorizontal=&quot;true&quot;
              android:layout_centerVertical=&quot;true&quot;
              android:text=&quot;@string/new_group&quot;
              android:textColor=&quot;@color/yellow&quot;
              android:textSize=&quot;20sp&quot; /&gt;
      &lt;/RelativeLayout&gt;
  
      &lt;!-- Group Name --&gt;
  
      &lt;LinearLayout
          android:id=&quot;@+id/groupNameLinearLayout&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_alignParentLeft=&quot;true&quot;
          android:layout_alignParentRight=&quot;true&quot;
          android:layout_below=&quot;@+id/newGroupTitleLayout&quot;
          android:layout_marginBottom=&quot;5dp&quot;
          android:layout_marginTop=&quot;15dp&quot;
          android:orientation=&quot;vertical&quot; &gt;
  
          &lt;TextView
              android:id=&quot;@+id/groupNameTextView&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:layout_marginLeft=&quot;15dp&quot;
              android:text=&quot;@string/group_name&quot;
              android:textColor=&quot;@color/yellow&quot; /&gt;
  
          &lt;EditText
              android:id=&quot;@+id/groupNameEditText&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;35dp&quot;
              android:layout_marginLeft=&quot;15dp&quot;
              android:layout_marginRight=&quot;15dp&quot;
              android:layout_marginTop=&quot;5dp&quot;
              android:background=&quot;@drawable/full_textfield&quot;
              android:ems=&quot;10&quot;
              android:inputType=&quot;text&quot;
              android:nextFocusRight=&quot;@+id/stateEditText&quot;
              android:paddingLeft=&quot;15dp&quot;
              android:singleLine=&quot;true&quot; &gt;
          &lt;/EditText&gt;
      &lt;/LinearLayout&gt;
  
      &lt;RelativeLayout
          android:id=&quot;@+id/addMemberLayout&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;290dp&quot;
          android:layout_below=&quot;@+id/groupNameLinearLayout&quot;
          android:layout_marginLeft=&quot;15dp&quot;
          android:layout_marginRight=&quot;15dp&quot;
          android:layout_marginTop=&quot;10dp&quot;
          android:background=&quot;@drawable/membersbox&quot; &gt;
  
          &lt;!-- View used when more than 1 member present --&gt;
  
          &lt;GridView
              android:id=&quot;@+id/mebersListGridView&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;match_parent&quot;
              android:fastScrollAlwaysVisible=&quot;true&quot;
              android:gravity=&quot;center&quot;
              android:numColumns=&quot;auto_fit&quot;
              android:padding=&quot;10dp&quot;
              android:verticalSpacing=&quot;10dp&quot;
              android:visibility=&quot;gone&quot; /&gt;
  
          &lt;!-- View when there are no members --&gt;
  
          &lt;RelativeLayout
              android:id=&quot;@+id/zeroMembersLayout&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;match_parent&quot;
              android:layout_centerHorizontal=&quot;true&quot; &gt;
  
              &lt;ImageButton
                  android:id=&quot;@+id/addMemeberImageButton&quot;
                  android:layout_width=&quot;90dp&quot;
                  android:layout_height=&quot;90dp&quot;
                  android:layout_centerHorizontal=&quot;true&quot;
                  android:layout_marginTop=&quot;70dp&quot;
                  android:background=&quot;@drawable/buttonanim_addmembersmall_button&quot;
                  android:contentDescription=&quot;@string/todo&quot; /&gt;
  
              &lt;LinearLayout
                  android:id=&quot;@+id/memberCountStatementTextViewtLayout&quot;
                  android:layout_width=&quot;wrap_content&quot;
                  android:layout_height=&quot;25dp&quot;
                  android:layout_alignParentLeft=&quot;true&quot;
                  android:layout_alignParentRight=&quot;true&quot;
                  android:layout_below=&quot;@+id/addMemeberImageButton&quot;
                  android:layout_marginTop=&quot;10dp&quot;
                  android:gravity=&quot;center&quot;
                  android:orientation=&quot;horizontal&quot; &gt;
  
                  &lt;TextView
                      android:layout_width=&quot;wrap_content&quot;
                      android:layout_height=&quot;wrap_content&quot;
                      android:text=&quot;@string/this_group_has_&quot;
                      android:textColor=&quot;@android:color/white&quot;
                      android:textSize=&quot;19sp&quot; /&gt;
  
                  &lt;TextView
                      android:id=&quot;@+id/groupMembersCount&quot;
                      android:layout_width=&quot;wrap_content&quot;
                      android:layout_height=&quot;wrap_content&quot;
                      android:text=&quot;@string/_0&quot;
                      android:textColor=&quot;@color/yellow&quot;
                      android:textSize=&quot;20sp&quot;
                      android:textStyle=&quot;bold&quot; /&gt;
  
                  &lt;TextView
                      android:layout_width=&quot;wrap_content&quot;
                      android:layout_height=&quot;wrap_content&quot;
                      android:text=&quot;@string/_members&quot;
                      android:textColor=&quot;@android:color/white&quot;
                      android:textSize=&quot;19sp&quot; /&gt;
              &lt;/LinearLayout&gt;
  
              &lt;TextView
                  android:layout_width=&quot;wrap_content&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:layout_below=&quot;@+id/memberCountStatementTextViewtLayout&quot;
                  android:layout_centerHorizontal=&quot;true&quot;
                  android:text=&quot;@string/tap_to_add_friends&quot;
                  android:textColor=&quot;@android:color/white&quot;
                  android:textSize=&quot;16sp&quot; /&gt;
          &lt;/RelativeLayout&gt;
      &lt;/RelativeLayout&gt;
  
      &lt;!-- Create group button --&gt;
  
      &lt;ImageButton
          android:id=&quot;@+id/creategroupbutton&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;50dp&quot;
          android:layout_below=&quot;@+id/addMemberLayout&quot;
          android:layout_marginBottom=&quot;15dp&quot;
          android:layout_marginLeft=&quot;15dp&quot;
          android:layout_marginRight=&quot;15dp&quot;
          android:layout_marginTop=&quot;15dp&quot;
          android:background=&quot;@drawable/buttonanim_creategroup_button&quot;
          android:contentDescription=&quot;@string/todo&quot; /&gt;
  &lt;/RelativeLayout&gt;
  &lt;/ScrollView&gt;
  </code></pre>
  <p>Could anyone help me out with this?</p>
  <p>Your help is appreciated.</p>