In the above code the calendar that is in the middle is actually a gridview. As you can see it is not covering the whole space and there is a black background that is visible. How do i stretch the columns or rows so that there is not black space present.
the xml for the gridview is as follows:
<GridView android:id="@+id/calendar"
android:numColumns="7"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</GridView>
thank you in advance.
Edit:
Update two
There is still some spaces in right of calendar.How to remove it?
Edit: Update 3
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_above="@id/menuoptions">
<RelativeLayout style="@style/widescreen"
android:background="@drawable/top_header">
<ImageView style="@style/compactview" android:src="@drawable/banner1"
android:layout_marginLeft="5dip" android:id="@+id/bannerview"
android:layout_centerVertical="true"></ImageView>
<ImageView style="@style/compactview" android:src="@drawable/logo"
android:layout_marginRight="20dip" android:layout_alignParentRight="true"></ImageView>
</RelativeLayout>
<LinearLayout style="@style/widescreen"
android:background="#ffffff" android:orientation="vertical">
<LinearLayout style="@style/widescreen"
android:background="#ffffff" android:orientation="horizontal">
<Button style="@style/compactview" android:background="@drawable/kalenderhover"
android:layout_marginLeft="3dip" android:onClick="calendarButtonClicked"
android:id="@+id/calendarbutton" android:layout_marginTop="6dip"
android:layout_marginBottom="5dip"></Button>
<Button style="@style/compactview" android:background="@drawable/tag"
android:onClick="dayButtonClicked" android:id="@+id/daybutton"
android:layout_marginTop="6dip" android:layout_marginBottom="5dip"></Button>
<Button style="@style/compactview" android:background="@drawable/monat"
android:id="@+id/monthbutton" android:onClick="monthButtonClicked"
android:layout_marginTop="6dip" android:layout_marginBottom="5dip"></Button>
<Button style="@style/compactview" android:background="@drawable/jahr"
android:id="@+id/yearbutton" android:onClick="yearButtonClicked"
android:layout_marginTop="6dip" android:layout_marginBottom="5dip"></Button>
<Spinner style="@style/compactview" android:id="@+id/category_name"
android:background="@drawable/categoriahover"
android:layout_marginLeft="5dip" android:layout_marginTop="7dip"
android:layout_marginBottom="4dip"></Spinner>
</LinearLayout>
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:background="@drawable/calenderheaderwithoutarrow"
android:id="@+id/calendarheader">
<ImageView android:id="@+id/prevMonth" android:src="@drawable/left_arrow"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dip" android:layout_marginTop="5dip">
</ImageView>
<Button android:id="@+id/currentMonth" android:layout_weight="0.6"
android:textColor="#FFFFFF" android:textAppearance="?android:attr/textAppearanceMedium"
android:background="@android:color/transparent"
android:layout_width="wrap_content" android:layout_height="wrap_content">
</Button>
<ImageView android:layout_marginRight="10dip" android:id="@+id/nextMonth"
android:src="@drawable/right_arrow" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_marginTop="5dip">
</ImageView>
</LinearLayout>
<ViewFlipper android:id="@+id/mainflipper" style="@style/compactview">
<LinearLayout android:id="@+id/calendartab" style="@style/compactview"
android:orientation="vertical">
<GridView android:id="@+id/calendar" android:numColumns="7"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:listSelector="@drawable/datecell"
android:layout_marginRight="0dip" android:paddingRight="0dip">
</GridView>
<ListView android:id="@+id/eventlist" style="@style/widescreen">
</ListView>
</LinearLayout>
<LinearLayout android:id="@+id/daytab" style="@style/compactview"
android:orientation="vertical">
<LinearLayout style="@style/compactview"
android:background="@drawable/calenderheader">
<EditText style="@style/compactview" android:id="@+id/searchkeyword"
android:hint="Suche" android:inputType="text"
android:layout_marginLeft="5dip" android:minWidth="200dip">
</EditText>
<Button android:onClick="searchingButtonClicked"
android:background="@drawable/abbrechen"
android:layout_marginLeft="5dip" style="@style/compactview"
android:layout_gravity="center_vertical|right"></Button>
</LinearLayout>
<ListView android:id="@+id/daylisting" style="@style/compactview"></ListView>
</LinearLayout>
<LinearLayout android:id="@+id/monthtab" style="@style/compactview"
android:orientation="vertical">
<LinearLayout style="@style/compactview"
android:background="@drawable/calenderheader">
<EditText style="@style/compactview" android:id="@+id/searchkeyword"
android:hint="Suche" android:inputType="text"
android:layout_marginLeft="5dip" android:minWidth="200dip">
</EditText>
<Button android:onClick="searchingButtonClicked"
android:background="@drawable/abbrechen"
android:layout_marginLeft="5dip" style="@style/compactview"
android:layout_gravity="center_vertical|right"></Button>
</LinearLayout>
<ListView android:id="@+id/monthlisting" style="@style/compactview"></ListView>
</LinearLayout>
<LinearLayout android:id="@+id/yeartab" style="@style/compactview"
android:orientation="vertical">
<LinearLayout style="@style/compactview"
android:background="@drawable/calenderheader">
<EditText style="@style/compactview" android:id="@+id/searchkeyword"
android:hint="Suche" android:inputType="text"
android:layout_marginLeft="5dip" android:minWidth="200dip">
</EditText>
<Button android:onClick="searchingButtonClicked"
android:background="@drawable/abbrechen"
android:layout_marginLeft="5dip" style="@style/compactview"
android:layout_gravity="center_vertical|right"></Button>
</LinearLayout>
<ListView android:id="@+id/yearlisting" style="@style/compactview"></ListView>
</LinearLayout>
</ViewFlipper>
</LinearLayout>
</RelativeLayout>
Compact view is width and height set to wrap_content