Android TableLayout不会垂直滚动

Ody*_*sey 3 android android-layout

在此先感谢您的帮助.我是Android新手.

这是我的问题.我正在使用TableLayout来显示可编辑的字段.大约有20行要显示.

行在较小的设备上溢出屏幕.我需要View以允许用户上下滚动.我错过了什么?

试图在ScrollView中包装TableLayout不起作用.

Rav*_*342 9

把你的TableLayout内心ScrollView

<?xml version="1.0" encoding="utf-8"?>
    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/scrollView1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

        <TableLayout
            android:id="@+id/tableLayout1"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" >

            <TableRow
                android:id="@+id/tableRow1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" >

            </TableRow>



        </TableLayout>

    </ScrollView>
Run Code Online (Sandbox Code Playgroud)