appcompat v7 溢出图标颜色在 V-21 中不同
appcompat v7 overflow icon color different in V-21
我有 Imagebutton
和 src="@drawable/abc_ic_menu_moreoverflow_mtrl_alpha"
使用 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" />
显示 黑色 溢出按钮直到 api 20。在 api >=21 它显示白色 图标在我的布局中无法正确显示。
查看图片。
奇巧
棒棒糖
可以看到,>=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
用指定的颜色给图像着色效果很好。
我有 Imagebutton
和 src="@drawable/abc_ic_menu_moreoverflow_mtrl_alpha"
使用 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" />
显示 黑色 溢出按钮直到 api 20。在 api >=21 它显示白色 图标在我的布局中无法正确显示。
查看图片。
奇巧
棒棒糖
可以看到,>=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
用指定的颜色给图像着色效果很好。