I am hiding a child from a gridview by setting its visibility to View.GONE. The problem is that even thought I set it to GONE, it becomes invisible but remais still a gap where it was located.
Is it possible to rearrange the gridview, so that the hidden elements don’t occupy any space in the layout?
<GridView
android:id="@+activity_queues/gv_queue1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:columnWidth="200dp"
android:horizontalSpacing="10dp"
android:numColumns="auto_fit"
android:padding="10dp"
android:stretchMode="none"
android:verticalSpacing="10dp" >
</GridView>
To remove a single item from your GridView, you have to remove it from the Adapter or the GridView’s data source. Since, as you discovered, changing the visibility of a cell won’t rearrange your layout, it will just show a blank cell for that item.