0

我正在为我的 android 应用程序设计布局。有一个页眉和一个页脚固定。我在它们之间放了一个滚动视图,一切正常,除了内容的最后一行被页脚隐藏,我不知道如何修复它!

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:background="#EEEEEE">
<!-- HEADER -->
    <LinearLayout
        android:id="@+id/headerr"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        <ImageView
            android:src="@drawable/header"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/imageViewHeader" />
    </LinearLayout>
<!-- CONTENT LAYOUT -->
    <LinearLayout
        android:id="@+id/content"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:paddingTop="40dip">
    <!-- BEGIN CONTENT -->
        <ScrollView
            android:minWidth="25px"
            android:minHeight="25px"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:id="@+id/scrollView1"
            android:background="#EEEEEE">
            <LinearLayout
                android:orientation="vertical"
                android:minWidth="25px"
                android:minHeight="50px"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:id="@+id/linearLayout1"
                android:background="#EEEEEE">
                <TextView
                    android:text="MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText MediumText"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:id="@+id/textView"
                    android:textColor="#000000" />
            </LinearLayout>
        </ScrollView>
    <!-- END CONTENT -->
    </LinearLayout>
<!-- FOOTER -->
    <RelativeLayout
        android:id="@+id/footer"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:orientation="horizontal">
        <ImageView
            android:src="@drawable/footer"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_above="@id/footer"
            android:id="@+id/imageViewFooter"
            android:adjustViewBounds="true" />
    </RelativeLayout>
</RelativeLayout>

感谢帮助我:-)

4

1 回答 1

1

您可以使用layout_belowandlayout_above将内容保留在页眉和页脚之间(无需手动设置paddingTop)。-

<LinearLayout
    android:id="@+id/content"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/headerr"
    android:layout_above="@+id/footer"
    android:orientation="horizontal">

顺便说一句,您的标头 id ( @+id/headerr)中有错字

于 2013-04-17T13:54:10.190 回答