簡體   English   中英

Android RelativeLayout Z訂單分層

[英]Android RelativeLayout Z Order Layering

我的activity_main.xml出現問題,在其中,如以下布局中所示的底部顯示似乎切斷了我的主要片段容器的底部,並分層放置在其頂部,而不是顯示在其下方。

底部欄應顯示在主着色器下方,而不是在其上方分層。

我嘗試了所有方法后,有人可以幫我嗎

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
    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:id="@+id/drawer_layout_new"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:openDrawer="start">

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

    <include
        android:id="@+id/my_toolbar"
        layout="@layout/toolbar">
    </include>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <FrameLayout
            android:id="@+id/fragmentContainerNew"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_alignParentTop="true"
            android:layout_above="@+id/bottomBar" />

        <com.roughike.bottombar.BottomBar
            android:id="@+id/bottomBarNew"
            android:layout_width="match_parent"
            android:layout_height="60dp"
            android:layout_alignParentBottom="true"
            app:bb_tabXmlResource="@xml/bottombar_tabs" />

    </RelativeLayout>

</LinearLayout>

<android.support.design.widget.NavigationView
    android:id="@+id/nav_view"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    android:fitsSystemWindows="true"
    app:menu="@menu/activity_main_drawer" />

activity_main的底部

您忘記添加正確的ID @+id/bottomBarNew ,更改您的值:

    <FrameLayout
        android:id="@+id/fragmentContainerNew"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentTop="true"
        android:layout_above="@+id/bottomBarNew" />  //<---here

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM