I have a GridView in my main layout as follows:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<GridView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gridview"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center"
android:horizontalSpacing="1dp"
android:stretchMode="columnWidth"
android:verticalSpacing="1dp" />
</LinearLayout>
which produces a grid like this
the contents of each cell is a layout like this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@drawable/btn_measurement" >
<Button
android:id="@+id/numerical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="---" />
</LinearLayout>
But I want the 4th column to be one-third of other columns and I just can't.
I checked the links:
GridView with different column sizes and Android GridView Column Stretching
but they were of no help. :(
if you think that I need to change my solution entirely please be more precise than just giving a general clue. Thanx