【发布时间】:2020-07-17 07:32:57
【问题描述】:
如何将“我们的联系人”项目设为白色?(下图) Current Navigation Drawer
我下面有一个代码,它是来自 Android Studio 的项目模板。
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.google.android.material.navigation.NavigationView
android:id="@+id/nav_view"
app:headerLayout="@layout/nav_header_main"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@color/colorPrimary"
android:fitsSystemWindows="true"
app:itemTextColor="@color/colorAccent"
app:menu="@menu/activity_main_drawer" />
</androidx.drawerlayout.widget.DrawerLayout>
我的 activity_main_drawer xml 菜单文件:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="navigation_view">
<group>
<item android:title="@string/about_toefl"
android:id="@+id/menu_nav_about_toefl"/>
<item android:title="@string/about_toefl"
android:id="@+id/menu_nav_the_toefl_itp_tests"/>
<item android:title="@string/about_toefl"
android:id="@+id/menu_nav_the_toefl_itp_digital_tests"/>
<item android:title="@string/about_toefl"
android:id="@+id/menu_nav_contact_us"/>
<item android:title="@string/about_toefl"
android:id="@+id/menu_nav_about_us"/>
</group>
<group>
<item android:title="@string/our_contacts">
<menu>
<item android:title="@string/toefl_ucok_org_kz"/>
<item android:title="@string/phone_7_747_857_97_61"/>
</menu>
</item>
</group>
</menu>
这是使用项目模板创建的 非常感谢。
【问题讨论】:
标签: android android-studio navigation-drawer