Im having a problem in stretching my GridView to fit Display-Width. Any one knows how so solve the problem? I want the GridView to occupy the whole width including the blue marked field (see pic below)
<TableRow>
<ProgressBar
android:id="@+id/timeBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="4"
/>
<TextView
android:id="@+id/points"
android:gravity="center"
android:textColor="#FFE7BA"
android:textSize="18px"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_weight="1"
/>
</TableRow>
<TableRow
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:text="KANJI"
android:gravity="center_horizontal"
android:background="#aa0000"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="2"
/>
</TableRow>
<TableRow>
<GridView
android:id="@+id/gridview"
android:numColumns="2"
android:layout_gravity="center"
android:stretchMode="columnWidth"
/>
</TableRow>
SCREENSHOT: http://i53.tinypic.com/2poy136.jpg
You need a
layout_widthdefined for your nestedGridViewso that its container knows how much space it needs:You should also provide a layout_height to avoid any unexpected behavior.