1

我创建了一个可向各个方向滚动的 TableLayout。为了创建一个固定页眉,我创建了一个额外的 TableLayout。现在我有 2 个可滚动的表格布局。

但是当我滚动 1 TableLayout 时,另一个 TableLayout 没有滚动。如何让它们同步滚动?

这是我的布局:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:id="@+id/container"
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent">

    <TwoDScrollView android:id="@+id/Scroll"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content">

            <TableLayout android:id="@+id/TableLayoutHours"
                         android:layout_width="fill_parent"
                         android:layout_height="wrap_content"
                         android:stretchColumns="0"/>

    </TwoDScrollView>

    <TwoDScrollView android:id="@+id/Scroll2"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent">

            <TableLayout android:id="@+id/TableLayoutLineUp"
                         android:layout_width="fill_parent"
                         android:layout_height="wrap_content"
                         android:stretchColumns="0"/>

    </TwoDScrollView>

</LinearLayout>
4

0 回答 0