I need to show some data in a grid-like format. For that purpose, I am using a ListView and I have a separate XML layout defined for ListViewROW.
Main.xml:
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/newback" >
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<Tablerow> SOME OTHER CONTROLS HERE </Tablerow>
<Tablerow>
<ListView
android:id="@+id/mylistview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="10dp">
</ListView>
</Tablerow>
</TableLayout>
</TableLayout>
ListViewRow.xml
<TableLayout
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical"
android:weightSum="1">
<TableRow
android:id="@+id/tableRow1"
android:layout_width="fill_parent"
android:layout_height="60dp"
android:weightSum="1">
<TextView
android:id="@+id/col1"
android:layout_width="100dp"
android:layout_height="50dp"
android:clickable="true"
android:padding="5dip"
android:gravity="left"/>
<TextView android:id="@+id/col2"/>
<TextView android:id="@+id/col3"/>
<TextView android:id="@+id/col4"/>
<Spinner
android:id="@+id/cmbOptions"
android:layout_width="100dp"
android:layout_height="50dp"
android:clickable="true"
android:padding="5dip"
android:gravity="left"
android:drawSelectorOnTop="true"
android:prompt="@string/optionPrompt"/>
android:text="" />
<ImageView
android:id="@+id/imagecorrectivedocument"
android:layout_width="35dp"
android:layout_height="35dp"
android:background="@drawable/crane_ins"
android:clickable="true"/>
</TableRow>
</TableLayout>
Problem:
The problem is that in the resultant grid, the spinner control is not fully visible. Please see the screen shot:
.
How do I fix this problem?
In the XML for the spinner, try: