Android layout 修复碎片大小

Android layout 修复碎片大小,android-layout,android-fragments,Android Layout,Android Fragments,我有两个碎片。两者都包含一些按钮和列表视图。我在单独的容器中垂直显示这两个片段。但是,如果列表视图包含更多项,下面的片段将被删除。如何显示两个大小固定的片段?i、 e.筛网应分为两部分。在本例中,顶部容器覆盖筛网的70%,底部容器覆盖筛网的30% <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="ver

我有两个碎片。两者都包含一些按钮和列表视图。我在单独的容器中垂直显示这两个片段。但是,如果列表视图包含更多项,下面的片段将被删除。如何显示两个大小固定的片段?i、 e.筛网应分为两部分。

在本例中,顶部容器覆盖筛网的70%,底部容器覆盖筛网的30%

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:weightSum="100">


    <FrameLayout android:id="@+id/container_top"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="70"/>

    <FrameLayout android:id="@+id/container_bottom"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="30"/>

</LinearLayout>

在本例中,顶部容器覆盖屏幕的70%,底部容器覆盖屏幕的30%

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:weightSum="100">


    <FrameLayout android:id="@+id/container_top"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="70"/>

    <FrameLayout android:id="@+id/container_bottom"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="30"/>

</LinearLayout>


很高兴听到这个消息!你可以接受左边的答案,这样人们就知道这个问题已经解决了:)很高兴听到!你可以接受左边的答案,这样人们就知道这个问题已经解决了:)