[英]Android - Change tint background color to navigation drawer?
You need update latest support library. 您需要更新最新的支持库。
latest version- 25.4.0 最新版本 - 25.4.0
Add this repository in, 添加此存储库,
allprojects {
repositories {
maven {
url "https://maven.google.com"
}
}
}
Project level build.gradle 项目级build.gradle
Update your xml 更新你的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.
尝试这个 :
yourDrawerLayout.setScrimColor(Color.GREEN);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.