0
我想要有一个导航视图,其中第一组textColor是黑色,第二组是lightGrey。Android NavigationView双文本颜色
我似乎只能在NavigationView xml配置中指定一种颜色。
有没有办法来覆盖这种行为?
我的导航视图菜单:
<group
android:id="@+id/navGroupMain"
android:checkableBehavior="single">
<item
android:id="@+id/nav_dashboard"
android:icon="@drawable/ic_dashboard"
android:title="@string/navigation_drawer_item_dashboard" />
</group>
<group
android:id="@+id/navGroupFooter"
android:checkableBehavior="single">
<item
android:id="@+id/nav_settings"
android:icon="@drawable/ic_settings"
android:title="@string/navigation_drawer_item_settings" />
</group>
这是插入NavigationView
<style name="AppTheme.ThemeOverlay.NavigationView" parent="ThemeOverlay.AppCompat.Light">
<!-- This is the menu item text color. -->
<item name="android:textColorPrimary">@color/black</item>
<!-- This is the menu header text color and icon color. -->
<item name="android:textColorSecondary">@color/grey_500</item>
<!-- This is the selected color. -->
<item name="colorPrimary">@color/colorPrimary</item>
</style>
文章最后一段代码,请 – Haroon
我的代码工作,请接受它的答案! –