Comment régler la transparence de la Navigation tiroir arrière-plan?
J'ai besoin d'être en mesure de définir l'arrière-plan, est complètement transparent. Semble que personne n'a essayé avant . S'il vous plaît aider.
Si je suis correct, nous devons faire framelayout backgrund totalement transparente . Mais aucun effet de prendre place sur le faire.
Merci à tous pour vos réponses , mais aucune ne lui semble être au travail jusqu'à présent.
Pour clarifier davantage , j'ai besoin de faire le contexte ci-dessous la liste pour être transparent.
Qui est, lorsque le tiroir est complètement ouvert .Il y a un écran partielle de l'activité ci-dessous qui est visible. Il montre que des troubles de la grisé avec un peu de texte visible. J'ai besoin de ça pour être parfaitement visible.
Ce que je dois modifier certains thèmes dans l'activité?
La suivante est la mise en page xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/navDraweLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/headerLayout"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/headerBlue"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="10dp" >
<Button
android:id="@+id/drawer_btn"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_alignParentLeft="true"
android:background="@color/logoutBtnBlue"
android:onClick="drawerBtnClicked"
android:padding="5dp"
android:textColor="@color/white" />
<TextView
android:id="@+id/headerText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center"
android:text="PeepApp"
android:textColor="@color/white"
android:textSize="25dp" />
<Button
android:id="@+id/logout_btn"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:background="@color/logoutBtnBlue"
android:onClick="logoutBtnClicked"
android:padding="5dp"
android:text="Logout"
android:textColor="@color/white" />
</RelativeLayout>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="1"
android:background="@android:color/transparent"
>
<FrameLayout
android:id="@+id/content_frame"
android:alpha="0.3"
android:background="#00000000"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!--
android:layout_gravity="start" tells DrawerLayout to treat
this as a sliding drawer on the left side for left-to-right
languages and on the right side for right-to-left languages.
The drawer is given a fixed width in dp and extends the full height of
the container. A solid background is used for contrast
with the content view.
-->
<ListView
android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@color/logoutBtnBlue"
android:choiceMode="singleChoice"
android:divider="@android:color/white"
android:dividerHeight="1dp" />
</android.support.v4.widget.DrawerLayout>
Juste pour préciser, c'est l'été posées et répondues sur SOI - ici. Cheers!
OriginalL'auteur Utsav Gupta | 2014-05-22
Vous devez vous connecter pour publier un commentaire.
Ne sais pas si je vous comprends, je vais vous donner un coup de feu. Voyons voir. Si je ne me trompe pas, vous ne pouvez pas voir le tiroir lui-même. Ce que vous voyez est la liste à l'intérieur d'elle. Afin de définir ses arrière-plan transparent tout ce que vous devez faire est de mettre en
à votre ListView XML.
Qui va le rendre totalement invisible, mais si vous voulez de la transparence avec un peu de couleur, vous pouvez utiliser accepté de répondre à ici de choisir la bonne valeur.
Espère que cette aide.
OriginalL'auteur Selz