如何在特定项目的底部显示折叠的项目?

时间:2019-01-20 10:27:46

标签: android bottomnavigationview

在活动xml中,我有一个slideUpPanelLayout,我想在活动的主要项目的底部导航视图顶部显示布局的折叠视图。但是,由于某些原因,它总是显示在底部导航视图的下方,我也不希望在展开折叠式布局时底部导航视图位于顶部。

这是我的XML:

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/white"
    android:fitsSystemWindows="true"
    android:layoutDirection="rtl">


    <com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:sothree="http://schemas.android.com/apk/res-auto"
        android:id="@+id/sliding_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="bottom"
        sothree:umanoOverlay="true"
        sothree:umanoPanelHeight="@dimen/slideup_panel_height"
        sothree:umanoParallaxOffset="@dimen/slideup_paralax_offset"
        sothree:umanoShadowHeight="@dimen/slideup_shadow_height">

        <!-- MAIN CONTENT -->
        <android.support.constraint.ConstraintLayout
            android:id="@+id/player_container"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <!-- Toolbar -->
            <include
                android:id="@+id/appbar"
                layout="@layout/app_bar_main"
                sothree:layout_constraintLeft_toLeftOf="parent"
                sothree:layout_constraintLeft_toRightOf="parent"
                sothree:layout_constraintTop_toTopOf="parent" />

            <android.support.design.widget.BottomNavigationView
                android:id="@+id/navigationView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/white"
                app:itemBackground="@color/white"
                app:itemIconTint="@color/nav_selector"
                app:itemTextColor="@color/nav_selector"
                app:layout_constraintBottom_toBottomOf="parent"
                app:menu="@menu/bottom_navigation" />

        </android.support.constraint.ConstraintLayout>

        <!-- SLIDING LAYOUT -->
        <LinearLayout xmlns:sothree="http://schemas.android.com/apk/res-auto"
            android:id="@+id/dragView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fitsSystemWindows="true"
            android:layoutDirection="rtl"
            android:orientation="vertical">

            <android.support.constraint.ConstraintLayout
                android:id="@+id/collapsed_layout"
                android:layout_width="match_parent"
                android:layout_height="@dimen/slideup_panel_height"
                android:background="@color/colorPlayerBackground">

            </android.support.constraint.ConstraintLayout>

            <LinearLayout
                android:id="@+id/expanded_layout"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@color/colorPlayerBackground"
                android:gravity="center"
                android:orientation="vertical"
                sothree:layout_constraintEnd_toEndOf="parent"
                sothree:layout_constraintStart_toStartOf="parent">

            </LinearLayout>
        </LinearLayout>

    </com.sothree.slidinguppanel.SlidingUpPanelLayout>

</android.support.v4.widget.DrawerLayout>

0 个答案:

没有答案