Search code examples
androidandroid-layoutandroid-appcompatoverflow-menu

appcompat v7 overflow icon color different in V-21


I have Imagebutton with src="@drawable/abc_ic_menu_moreoverflow_mtrl_alpha" using appcompat-v7 21.0.3.

<ImageButton
  android:layout_width="@dimen/abc_action_button_min_height_material"
  android:layout_height="@dimen/abc_action_button_min_height_material"
  android:layout_alignParentRight="true"
  android:background="?attr/selectableItemBackground"
  android:src="@drawable/abc_ic_menu_moreoverflow_mtrl_alpha" />

It's showing me black overflow button until api 20. In api >=21 It shows white icon which is not visible correctly in my layout.

See Images.

In kitkat enter image description here

In Lollipop enter image description here

As seen, It's white in >=21 .

I have single styles.xml file for all versions as follows.

<style name="AppBaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/blue</item>
        <item name="colorAccent">@color/white</item>

    </style>

So , what should be hack here , any help would be great.

Note : -I am using this button in recyclerview item layout. 

       -Appcompat v7-22.2.0 produces the same result.

Solution

  • As suggested by @reVerse ,

    android:tint works great which tints the image with specified color.