I have following code for Gridview (To make the Calendar).
<GridView
android:id="@+id/calendar"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@+id/rl1"
android:layout_below="@+id/ll2"
android:columnWidth="250dp"
android:numColumns="7" >
</GridView>
Grid_Cell is as follows.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/calendar_button_selector" >
<Button
android:id="@+id/calendar_day_gridcell"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/calendar_button_selector"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000"
android:textSize="14.47sp" >
</Button>
<TextView
android:id="@+id/num_events_per_day"
style="@style/calendar_event_style"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center" >
</TextView>
I want to set no space between the rows and columns.
Existing view is as following.

Please help me out… Thanks in Advance
.
I will try to give you a snippet, but to be honest, there is no point of using a GridView for your case since all you items are there on the screen anyway. You can create a couple of
LinearLayouts in a small loop that will get the result.I would advice you to set the columnWidth on Runtime according to the screen width.
And your adapter should be fed with the column width and height to set them when inflating child views. And in this case, you need to get rid of numColumns. Remember that using numColumns along with columnWidth makes no sense especially when you want to fill the whole space. If you want to set the numColumns, remove the columnWidth.
SOLUTION:
Here is the outcome:

First, we create our layout. In my case, it is the
MainActivity‘s layout and is calledactivity_main.xml. (Notice there is no GridView because I’ll add that later in code):Our GridView element’s layout is here in the
item_grid.xml:Now the trick is in MainActivity (I have commented some of the code for you to understand):
package com.example.dynamicstaticgridview;
COMMENTS:
You’d really better find a decent algorithm to choose
mCellWidth,mCellHeight,numberOfColumns, andnumberOfRows.