Umano SlidingUpPanel无法在CoordinatorLayout中工作

时间:2017-09-09 18:08:42

标签: android layout slidingmenu

我正在使用Umano SlidingUpPanel设置如下视图:

The SlidingUpPanel shows as it should be when itś expanded

但无论我做什么,它都无法隐藏。相反,它是“偷看”:

The panel shows the Top-Most part of it

我需要它完全隐藏。这是我的XML资源

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
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_height="match_parent"
    android:layout_width="match_parent"
    xmlns:sothree="http://schemas.android.com/tools"
    android:id="@+id/coordinator_layout"
    tools:context="com.pocket.poktsales.activities.InventoryActivity">

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/AppTheme.PopupOverlay" />

    </android.support.design.widget.AppBarLayout>


    <ProgressBar
        android:id="@+id/progressBar"
        style="?android:attr/progressBarStyle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical|center_horizontal"
        app:layout_anchorGravity="center_vertical|center_horizontal" />


        <android.support.design.widget.FloatingActionButton
            android:id="@+id/fab"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|end"
            android:layout_margin="@dimen/fab_margin"
            android:src="@drawable/ic_box_add" />
        <com.sothree.slidinguppanel.SlidingUpPanelLayout
            android:layout_height="wrap_content"
            android:layout_width="match_parent"
            sothree:umanoDragView="@+id/sliding_up_panel"
            android:gravity="bottom"
            sothree:overlay="false"
            sothree:umanoPanelHeight="0dp"
            sothree:umanoParalaxOffset="100dp"
            sothree:umanoShadowHeight="4dp">
            <include
                android:id="@+id/include"
                layout="@layout/content_inventory" />
            <include android:id="@+id/sliding_up_panel"
                layout="@layout/content_product_detail"/>
        </com.sothree.slidinguppanel.SlidingUpPanelLayout>
</android.support.design.widget.CoordinatorLayout>

我试过了:

使用0 dp作为面板高度,没有结果。实际上,无论价值是多少,它都不会受到该属性的影响。

将其包裹在没有结果的布局内。

任何人都可以帮我完全隐藏它吗?

1 个答案:

答案 0 :(得分:0)

在我的特定情况下,我以编程方式添加了面板高度:

panel.setPanelHeight(0);

现在它正在运作!