Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/213.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Spinner在自定义ListView中不完全可见_Android_Android Layout_Android Listview_Spinner - Fatal编程技术网

Android Spinner在自定义ListView中不完全可见

Android Spinner在自定义ListView中不完全可见,android,android-layout,android-listview,spinner,Android,Android Layout,Android Listview,Spinner,我需要以网格格式显示一些数据。为此,我使用了ListView,并且为ListViewROW定义了一个单独的XML布局 Main.xml: <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@dr

我需要以网格格式显示一些数据。为此,我使用了ListView,并且为ListViewROW定义了一个单独的XML布局

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>

android:text=”“/>
问题

问题在于,在生成的栅格中,微调器控件不完全可见。请参见屏幕截图:


如何解决此问题?

在微调器的XML中,请尝试:

android:layout_gravity="center_vertical"

非常感谢,这对我很有效。你知道我在这个问题上花了4个小时吗????再次感谢!!