0

我不确定如何正确描述我的问题。我的布局包含一个带有线性布局的顶部菜单,下面是一个用滚动视图包裹的表格布局。我的问题是当我向上滚动时,内容表格布局向上移动并阻止顶部菜单视图。所以有人知道如何解决这个问题,请指出我。谢谢

这是我的代码:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/bg" >

    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/menu_bar"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:background="@drawable/menu_bar" >

    </LinearLayout>

    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:scrollbars="none" >

        <TableLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/myTableLayout"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="140dp"
            android:stretchColumns="1" >
        </TableLayout>
    </ScrollView>

</RelativeLayout>
4

1 回答 1

0

您必须将 ScrollView 设置在 LinearLayout 下方,否则它会堆叠在上面。

希望这可以帮助!

于 2012-06-23T13:52:31.737 回答