I want my main menu be a GridView of icons - 6 icons to be specific.
When the phone is in the portrait layout i want them to be in 2 columns, when it is in horizontal layout - 3 columns --- have sorted that out.
What I didnt sort out is how to make them occupy merely the whole screen.
Fitting it to the screen width is not a problem - it is fitting it to the screen height that makes me stumble.
I want it to stretch/shrink my cells depending on the screen size. I have tried counting screen height and dividing it by 3 - but there are certain problems and I dont think that that is the most elegant solution.
So basically how do I occupy my screen (say in a portrait layout) with a gridview of two columns (3 rows) solely? Are there any xml attributes that could help me?
This is my xml file:
<?xml version="1.0" encoding="utf-8"?>
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gridview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:verticalSpacing="10dp"
android:horizontalSpacing="10dp"
android:numColumns="auto_fit"
android:stretchMode="columnWidth"
android:gravity="center"
/>