I have a navigationView in my app and after add two lines in app style :
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
The Navigation icon color changed to black and for this problem i added this line in style :
<item name="android:textColorSecondary">@android:color/white</item>
Now navigation icon is white again but now i have a new problem . With above code , the title of navigation items is change color too.
I didn't find a solution to this Interference
Style :
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:textColorSecondary">@android:color/white</item>
</style>
Navigation Menu :
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="navigation_view">
<group
android:id="@+id/testGRP"
android:checkableBehavior="single"
>
<item android:title="???? : ?????? ????"
android:id="@+id/menuItem_StudentList11"
android:icon="@drawable/ic_arrow_drop_up"
/>
<item android:title="???? ????"
android:id="@+id/menuItem_StudentList_Quize1"
android:icon="@drawable/all_exam_icon"
/>
<item android:title="@string/Navigation_StudentList3"
android:id="@+id/menuItem_StudentList_Quize"
android:icon="@drawable/all_exam_icon"
/>
</group>
<item android:title="????????:"> //this line is title
<menu>
<item android:title="@string/Navigation_StudentList4"
android:id="@+id/menuItem_StudentList_MidTerm"
android:icon="@drawable/all_exam_icon"
/>
<item android:title="@string/Navigation_StudentList5"
android:id="@+id/menuItem_StudentList_EndTerm"
android:icon="@drawable/all_exam_icon"
/>
<item android:title="?????? ????"
android:id="@+id/menuItem_StudentList_Practical"
android:icon="@drawable/all_exam_icon"
/>
<item android:title="@string/Navigation_StudentList6"
android:id="@+id/menuItem_StudentList_Project"
android:icon="@drawable/all_projcet_icon"
/>
<item android:title="@string/Navigation_StudentList2"
android:id="@+id/menuItem_StudentList_Conference"
android:icon="@drawable/all_conference_icon"
/>
</menu>
</item>
<item android:title="@string/Navigation_StudentList1"
android:id="@+id/menuItem_StudentList1"
android:icon="@drawable/all_notifiicon_icon"
/>
<item android:title="@string/Navigation_StudentList7"
android:id="@+id/menuItem_StudentList7"
android:icon="@drawable/main_newclass_icon"
/>
</menu>
enter image description here
enter image description here
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…