I have a GridView and the text cells fills always vertically,
in addition for some strange reason the attribute Refer, that could be RDA or AI, is showed only if is RDA, AI seems invisible (my table in the column Refer hasn’t empty cells).
See this screenshot for better understanding

the GridView is populated with this method
private void populateGrid(){
Cursor c = dba.getNutriData():
startManagingCursor(c);
String[] from = new String[] { dba.Nutrient, dba.Intake, dba.Limit, dba.Refer};
int[] to = new int[] { R.id.txtNutrient, R.id.txtIntake, R.id.txtLimit, R.id.txtRefer};
SimpleCursorAdapter sca = new SimpleCursorAdapter(this, R.layout.grid_row, c, from, to);
grid.setAdapter(sca);
}
I use this GridView Layout
<GridView
android:id="@+id/tabellaDieta"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="false"
android:gravity="start"
android:numColumns="1"
android:scrollingCache="true"
android:stretchMode="columnWidth"
android:textAlignment="textStart" >
</GridView>
And this is the gridrow layout
<?xml version="1.0" encoding="utf-8"?>
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TableRow android:layout_gravity="left">
<TextView
android:id="@+id/colNome"
android:layout_width="50px"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_weight="1"
android:gravity="left|start"
android:padding="5px"
android:textColor="@color/white"
android:textSize="12dp" />
<TextView
android:id="@+id/colDose"
android:layout_width="50px"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_weight="1"
android:gravity="left|start"
android:padding="5px"
android:textColor="@color/greenlight"
android:textSize="12dp" >
</TextView>
<TextView
android:id="@+id/colLimite"
android:layout_width="50px"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_weight="1"
android:gravity="left|start"
android:padding="5px"
android:textColor="@color/orange"
android:textSize="12dp" />
<TextView
android:id="@+id/colRiferimento"
android:layout_width="50px"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_weight="1"
android:gravity="left|start"
android:padding="5px"
android:textColor="@color/light_sky"
android:textSize="12dp" >
</TextView>
</TableRow>
</TableLayout>
The value of this
android:layout_weight="1"and this lineandroid:padding="5px"and this lineandroid:numColumns="1"are critical.test it by removing the
weightandpaddingline and increase the number ofcolumnsalso you have fixed the width of
textViewhereandroid:layout_width="50px"make it toWrapContent