我有3次主要活動垂直對齊3次:toolbar
,MainContainer
& bottombar
如何與不同高度
- 的
toolbar
有60dp - 的
MainContainer
是一個高度配對父親 - 該
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>
仍然沒有顯示.. –
@SamZar的FrameLayout部分添加'機器人:layout_marginBottom = 「50dp」' –
它的工作原理,謝謝:d,但是你應該加入這一行太'Android設備上編輯答案:layout_marginBottom =」 50dp「' –