1
votes

I have a toolbar defined like so:

<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" >

I have a navigation drawer toggle button on the toolbar enabled in code (the hamburger menu button). I want it to be white but no matter what I do, it never changes color. I saw in an open source app that they set this in the theme:

<item name="colorControlHighlight">@color/white</item>

I tried it, but still no change for me - it's always the dark almost black color.

I am using this open source app for reference since it looks like it has a white menu button: https://github.com/frogermcs/InstaMaterial

I copied it as closely as I could, but my toolbar menu button never changes color. What am I doing wrong?

1
Is title of your Toolbar also not white?Sharj
It's white, but I can change it to black depending on the theme. The navigation icon never changes color.Barodapride
If it's white then Hamburger Icon should be white as well just like the title unless you are overriding it somewhere in your application by providing your own icon or color.Sharj
Also see this answer for setting style of Toolbar: stackoverflow.com/a/26447144/343679Sharj
That link worked. I had to define drawerArrowStyle in my app's theme. It's confusing because the app compat toolbar does not follow the app theme - for example, you have to manually set its primary color in the toolbar xml. But it does apparently follow the drawerArrowStyle for the navigation icon.Barodapride

1 Answers

0
votes

Make sure that your style is a parent of Theme.AppCompat.Light.DarkActionBar

also, if you have problems with the popup menu, please add this attribute to the Toolbar view app:popupTheme="@style/ThemeOverlay.AppCompat.Light"