2017-01-30 51 views
7

您好我想刪除工具欄的下方陰影的,我已經使用海拔財產, 目前我的代碼是當一套應用程序:海拔=「0dp」然後hamburgermenu沒有顯示的工具欄

<android.support.design.widget.CoordinatorLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:fitsSystemWindows="true"> 

    <android.support.design.widget.AppBarLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:background="@color/transparent"> 

     <android.support.v7.widget.Toolbar 
      android:id="@+id/toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 

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


    <FrameLayout 
     android:id="@+id/content_frame" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" /> 


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

和輸出: -

enter image description here

在這裏我不想下面的影子,所以我設置

app:elevation="0dp" 

到AppBarLayout, 然後它刪除陰影,但漢堡菜單消失。 新的輸出如下: - enter image description here

誰能告訴我我怎麼去除陰影沒有隱藏/消失HamburgerMenu。

回答

8

試試這個:

<android.support.design.widget.AppBarLayout 
      android:id="@+id/appBar" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      app:elevation="0dp"> 
      ... 
</android.support.design.widget.AppBarLayout> 

然後在您的活動;

findViewById(R.id.appBar).bringToFront(); 
+1

它的工作!謝謝。 :-) – Jayshree