henry000 henry000 - 1 year ago 160
Android Question

Back Arrow and Overflow Icons Wrong Color in Pre-Lollipop Devices After Updating to Support Library 23.2.0

On pre-Lollipop devices, the overflow menu icon and back button on actionbar changed to black color after upgrading to Support Library 23.2.0. They are white (which is the right color) before the upgrade.

The correct color is:
enter image description here

The wrong color appears for pre-Lollipop devices after the upgrade, as shown with the overflow menu icon:

enter image description here

The theme in sytle.xml (pre-v21/Lollipop):

<resources xmlns:android="http://schemas.android.com/apk/res/android" >
<!--Used on the application level by the manifest.-->
<style name="app_theme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/app_primary_colour</item>
<item name="colorPrimaryDark">@color/app_primary_dark_colour</item>
<item name="colorAccent">@color/app_accent_colour</item>
<item name="android:windowBackground">@color/app_background</item>
<item name="searchViewStyle">@style/custom_search_view_style</item>

<!--Used by activities.-->
<style name="app_theme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>

<!--TODO: What are these?-->
<style name="app_theme.app_bar_overlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="app_theme.popup_overlay" parent="ThemeOverlay.AppCompat.Light" /> ... ... </resources>

I have looked here and here but didn't fix the issue.

UPDATE: Also see this Google bug report: https://code.google.com/p/android/issues/detail?id=201918

Answer Source

I could fix.

I found that AppCompat theme is using following resource for overflow button: abc_ic_menu_overflow_material.xml

Content of this resource is:

<vector xmlns:android="http://schemas.android.com/apk/res/android"

Then, I connected the dots:

  • First: It is using colorControlNormal
  • Second: It is using vector


According to Library V23.2.0 Release notes (LINK HERE), we have to update build.gradle to add support to Vector:


Add following lines to your build gradle

Gradle 2.0 (I did not tested):

android {  
    defaultConfig {  
        vectorDrawables.useSupportLibrary = true  

Gradle 1.5 (I'm using this.. it works):

android {  
    defaultConfig {  
        generatedDensities = []  

    aaptOptions {  
        additionalParameters "--no-version-vectors"  

Fixing your theme

This step may be ignored. Some base themes already set colorControlNormal to white (such as AppCompat.Dark.ActionBar).

However, in my case, all button colors remained black and I had to add the colorControlNormal to my theme and override it with white color.

<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
    <item name="colorControlNormal">@color/white</item>

I hope this can help you.

This was how I fixed my issue.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download