Android的TableLayout没有垂直滚动 [英] Android TableLayout does not scroll vertically

查看:179
本文介绍了Android的TableLayout没有垂直滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

感谢您事先的任何帮助。我很新到Android。

Thanks in advance for any help. I am very new to Android.

下面是我的问题。我使用的是TableLayout显示可编辑的字段。大约有20行显示。

Here's my problem. I am using a TableLayout to display editable fields. There are about twenty rows to display.

该行溢出更小的设备屏幕。我需要的视图,允许用户上下滚动。我缺少什么?

The rows overflow the screen on smaller devices. I need the View to allow the user to scroll up and down. What am I missing?

想在一个滚动型包裹TableLayout,没有工作。

Tried wrapping the TableLayout in a ScrollView, didn't work.

推荐答案

把你的 TableLayout 滚动型

<?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>

这篇关于Android的TableLayout没有垂直滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆