0

我的活动包含 - ToolbarTabsViewPagerFloatingActionButtonDraggablePanel工具栏上方的可绘制面板

当我初始化我的可拖动面板时,它出现在Toolbar,FloatingButtonTabs之下。设置DraggablePanel.bringToFront()只会使其高于ViewPager。如何在初始化时将我的DraggablePanel高于一切?

布局文件:

<?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" 
    xmlns:draggable_panel="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/main_content" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:fitsSystemWindows="true" 
    tools:context="in.brewtv.activities.HomeActivity"> 

    <android.support.design.widget.AppBarLayout 
     android:id="@+id/appbar" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:paddingTop="@dimen/appbar_padding_top" 
     android:theme="@style/AppTheme.AppBarOverlay"> 

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

     </android.support.v7.widget.Toolbar> 

     <android.support.design.widget.TabLayout 
      android:id="@+id/tabs" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:fillViewport="false" 
      app:tabGravity="fill" 
      app:tabMode="fixed" /> 


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


    <android.support.v4.view.ViewPager 
     android:id="@+id/container" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     app:layout_behavior="@string/appbar_scrolling_view_behavior" /> 

    <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" 
     app:srcCompat="@drawable/change_mood" /> 

    <!-- DraggablePanel --> 

    <com.github.pedrovgs.DraggablePanel 
     android:id="@+id/draggable_panel" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     draggable_panel:x_scale_factor="2.3" 
     draggable_panel:y_scale_factor="2.3" 
     draggable_panel:top_fragment_height="200dp" 
     draggable_panel:top_fragment_margin_right="10dp" 
     draggable_panel:top_fragment_margin_bottom="10dp" 
     draggable_panel:enable_horizontal_alpha_effect="true"/> 


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

屏幕截图:

enter image description here

+0

你能分享一个截图吗? – azizbekian

+0

@azizbekian - 请立即检查 – jay

回答

1

尝试将海拔,更高的价值比你FAB设为您的DraggablePanel

<com.github.pedrovgs.DraggablePanel 
    android:id="@+id/draggable_panel" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:elevation="10dp" 
    draggable_panel:x_scale_factor="2.3" 
    draggable_panel:y_scale_factor="2.3" 
    draggable_panel:top_fragment_height="200dp" 
    draggable_panel:top_fragment_margin_right="10dp" 
    draggable_panel:top_fragment_margin_bottom="10dp" 
    draggable_panel:enable_horizontal_alpha_effect="true"/> 
+0

非常感谢:) – jay

+0

@jay不客气 –