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 creates a grid like this 
the contents of each cell are as follows:
<?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 fourth column to make up one third of the other columns, and I just can't.
I checked the links:
GridView with different column sizes and Android GridView Column Stretching
but they didnβt help. :(
if you think that I need to completely change my mind, please clarify how to just give a shared key. Thanx
source share