问题
I'm working with Navigation Drawer and i need to change the color of tint background from black to green. any ideas?
回答1:
Try This :
yourDrawerLayout.setScrimColor(Color.GREEN);
回答2:
You need update latest support library.
latest version- 25.4.0
Add this repository in,
allprojects {
repositories {
maven {
url "https://maven.google.com"
}
}
}
Project level build.gradle
Update your 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.
来源:https://stackoverflow.com/questions/45269338/android-change-tint-background-color-to-navigation-drawer