Je travaille avec Navigation Drawer et j'ai besoin de changer la couleur du fond de teinte du noir au vert. des idées?Android - Changer la couleur d'arrière-plan de teinte au tiroir de navigation?
2
A
Répondre
0
Essayez ceci:
yourDrawerLayout.setScrimColor(Color.GREEN);
0
Vous devez mettre à jour la plus récente bibliothèque de soutien.
dernière version- 25.4.0
Ajouter ce dépôt dans,
allprojects {
repositories {
maven {
url "https://maven.google.com"
}
}
}
niveau du projet build.gradle
Mettez à jour votre xml
<android.support.design.widget.NavigationView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@android:color/white"//Change background color
android:fitsSystemWindows="false"
app:headerLayout="@layout/drawer_header"//Set your header
app:itemIconTint="@color/colorPrimary"//Change Text color
app:menu="@menu/drawer" />// set your menu items.
n'est pas ce que j'ai demandé. vérifiez la photo ci-jointe. ce que vous dites est de changer à l'arrière-plan du tiroir, pas la couleur de la teinte. – Yoni
https://stackoverflow.com/questions/18129598/dont-display-the-overlay-with-the-android-navigation-drawer, https://stackoverflow.com/questions/26745300/navigation-drawer-semi-transparent -over-status-bar-not-working essayez ceci. – Santhosh
Ce lien a également résolu le problème – Yoni