2017-01-30 2 views
7

Salut je voulais supprimer l'ombre en dessous de la barre d'outils pour que je l'ai utilisé la propriété d'altitude, Actuellement mon code estlorsque l'application de jeu: élévation = « 0DP » alors hamburgermenu ne pas montrer à la barre d'outils

<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> 

et la sortie est: -

enter image description here

ici, je ne veux pas l'ombre ci-dessous, donc je mis

app:elevation="0dp" 

à AppBarLayout, puis il supprime l'ombre mais le HamburgerMenu a disparu. la nouvelle sortie est comme ci-dessous: - enter image description here

Quelqu'un peut-il me dire comment puis-je supprimer l'ombre sans se cacher/disparaître HamburgerMenu.

Répondre

8

essayez ceci:

<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> 

puis dans votre activité;

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

Cela a fonctionné! Je vous remercie. :-) – Jayshree