Android 使用固定页脚填充FrameLayout

Android 使用固定页脚填充FrameLayout,android,footer,android-framelayout,Android,Footer,Android Framelayout,在FrameLayout中,我动态添加了一个WebView,以便在旋转屏幕时保存内容,但情况并非如此,而是在FrameLayout下面我想放置一个固定的页脚。下一段代码将放置页脚,但框架布局不会填充屏幕 我想知道你的建议和建议,或者是否有一些技巧/例子可以实现这一点。谢谢你的帮助 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.and

在FrameLayout中,我动态添加了一个WebView,以便在旋转屏幕时保存内容,但情况并非如此,而是在FrameLayout下面我想放置一个固定的页脚。下一段代码将放置页脚,但框架布局不会填充屏幕

我想知道你的建议和建议,或者是否有一些技巧/例子可以实现这一点。谢谢你的帮助

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_no_margin"
android:paddingLeft="@dimen/activity_horizontal_no_margin"
android:paddingRight="@dimen/activity_horizontal_no_margin"
android:paddingTop="@dimen/activity_vertical_no_margin"
tools:context="${relativePackage}.${activityClass}" >

<ProgressBar
    android:id="@+id/progressBar1"
    style="?android:attr/progressBarStyleHorizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_margin="3dp"
    android:visibility="gone" />

<FrameLayout
    android:id="@+id/frameLayout1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_below="@+id/progressBar1"
    android:background="@color/layout_black"
    android:gravity="center_vertical|top" >
</FrameLayout>

<LinearLayout
    android:id="@+id/footer"
    android:layout_width="fill_parent"
    android:layout_height="36dp"
    android:layout_alignParentBottom="true"
    android:background="@color/layout_black"
    android:gravity="bottom|center_horizontal"
    android:paddingBottom="5dp"
    android:paddingLeft="5dp"
    android:paddingRight="5dp"
    android:paddingTop="5dp" >

    <ImageView
        android:id="@+id/iconAltara"
        android:layout_width="35dp"
        android:layout_height="30dp"
        android:contentDescription="@string/app_name"
        android:layout_marginRight="12dp"
        android:src="@drawable/ic_launcher" />
    <ImageView
        android:id="@+id/iconFacebook"
        android:layout_width="25dp"
        android:layout_height="25dp"
        android:layout_marginRight="15dp"
        android:contentDescription="@string/app_name"
        android:src="@drawable/facebook" />
    <ImageView
        android:id="@+id/iconInstagram"
        android:layout_width="25dp"
        android:layout_height="25dp"
        android:layout_marginRight="15dp"
        android:contentDescription="@string/app_name"
        android:src="@drawable/instagram" />

</LinearLayout>


将Framelayout的高度设置为“匹配父对象”,并使其位于页脚上方。如下所示

<FrameLayout
    android:id="@+id/frameLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentLeft="true"
    android:layout_above="@+id/footer"
    android:background="@color/layout_black"
    android:gravity="center_vertical|top" >
</FrameLayout>

尽情享受吧,没问题!