Issue
I am trying to implement navigation view using support library. Using primary color, the selected menu in navigation drawer is highlighted. But I want to remove the highlighted background of the selected item.
Solution
add <item name="colorControlHighlight">@color/yourColor</item>
to your Theme (in style.xml) and it will change the grey color.
setting the Color to @android:color/transparent
will solve your problem.
If you want to change the BackgroundColor when item is selected or pressed create a selector as a drawable and add
<item name="android:selectableItemBackground">@drawable/row_selector</item>
to the Theme
the selector (row_selector) could look somthing like this:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:drawable="@drawable/selected_gray"/>
<item android:state_pressed="true" android:drawable="@drawable/pressed_gray"/>
</selector>
Answered By - Pfennigbaum
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.