一个垂直方向的LinearLayout,包含两个View。下面一个View(工具栏)固定在屏幕底部,上面的View占据剩余的屏幕空间。

    <LinearLayout
        android:orientation="vertical"
        android:id="@+id/vertical_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <FrameLayout android:id="@+id/main_content"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
         />
        
        <FrameLayout android:id="@+id/fixed_bottombar_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
        />
    </LinearLayout>


android:layout_height="0dp" <!-- 这里不能设置fill_parent -->
android:layout_weight="1" <!-- 这里设置layout_weight=1是最关键的,否则底部的LinearLayout无法到底部 -->