【发布时间】:2018-01-14 08:58:30
【问题描述】:
我的主要活动有 3 个视图:toolbar、MainContainer& bottombar
-
toolbar的高度为 60dp -
MainContainer是 match-parent -
bottombar是 50dp
问题在于,bottombar 根本不显示,一旦将MainContainer 设置为match-parent,它就会填充布局的其余部分并将bottombar 推出可见区域!如果高度设置为wrap-content 也是一样的!!那么如何解决这个..!?
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="70dp"
android:background="@color/accent"/>
<FrameLayout
android:id="@+id/MainContainer"
android:layout_below="@id/toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary"/>
<com.roughike.bottombar.BottomBar
android:id="@+id/bottombar"
android:background="@color/black"
android:layout_below="@id/MainContainer"
android:layout_width="match_parent"
android:layout_height="50dp"/>
</RelativeLayout>
【问题讨论】:
标签: android xml android-layout android-linearlayout android-relativelayout