android - appcompat v7 溢出图标颜色与 V-21 不同

标签 android android-layout android-appcompat overflow-menu

我有使用 appcompat-v7 21.0.3 的 Imagebuttonsrc="@drawable/abc_ic_menu_moreoverflow_mtrl_alpha"

<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" />

在 api 20 之前,它向我显示黑色溢出按钮。在 api >=21 中,它显示白色图标,该图标在我的布局中不正确可见。

查看图片。

奇巧 enter image description here

在 Lollipop 中 enter image description here

如图所示,>=21 时它是白色的。

我有一个适用于所有版本的 styles.xml 文件,如下所示。

<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>

那么,这里应该破解什么,任何帮助都会很棒。

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

       -Appcompat v7-22.2.0 produces the same result.

最佳答案

根据@reVerse的建议,

android:tint 效果很好,可以用指定的颜色给图像着色。

关于android - appcompat v7 溢出图标颜色与 V-21 不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30643584/

相关文章:

android - 在 appcompat-v7 的工具栏中删除标题

Android 将一个 View 置于另一个之上

java - MPAndroidChart barchat 获取所选类别

Android - 在键盘启动时为 android 5.0 (lollipop) 调整 ScrollView

android - 更改方向时重新加载 ListView 中的数据

android - 即使 forceLayout() 不起作用,我如何强制 requestLayout()?

android - 我的工作区中额外的 `android-support-v7-appcompat` 项目来自哪里?使用哪一个?

java - 将 Double 转换为 ArrayList - Android

android - 占位符的 picasso 图书馆圆角

android - 如何使用 appcompat v7 创建卡片工具栏