我有使用 appcompat-v7 21.0.3 的 Imagebutton
和 src="@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 中,它显示白色图标,该图标在我的布局中不正确可见。
查看图片。
奇巧
在 Lollipop 中
如图所示,>=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/