如何使滚动TableLayout? [英] How to make a scrollable TableLayout?

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

问题描述

看看XML code在这里,请:

Look at the XML code here please:

<TableLayout
    android:id="@+id/tableLayout1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="10dip"
    xmlns:android="http://schemas.android.com/apk/res/android">

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

    <!-- Some stuff goes here -->

    />
    </TableRow>

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

    <!-- Some stuff goes here -->

    />
    </TableRow>

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

    <!-- Some stuff goes here -->

    />
    </TableRow>


</TableLayout>

我的code是更长的时间比,但我只是消除了不必要的部分。 问题是我想使这个 TableLayout 滚动,使所有的我的东西可以证明。

My code is much longer than that but I just eliminated the unnecessary parts. The problem is I want to make this TableLayout a scrollable so that all of my stuff can be shown.

我试图把此行的 TableLayout ,以使其滚动:

I tried to put this line in the TableLayout in order to make it scrollable:

android:isScrollContainer="true"

但它不会做的工作。 有没有办法?

推荐答案

包住整个事情:

<ScrollView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:scrollbars="none"
    android:layout_weight="1">
    <LinearLayout
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="vertical">

    ...

</ScrollView>

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

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