【发布时间】:2016-04-25 15:07:31
【问题描述】:
我正在尝试更改工具栏的溢出菜单图标颜色,如下所示:-
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar_actionbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/CustomPopup"
app:theme="@style/MyCustomToolBarTheme">
</android.support.v7.widget.Toolbar>
两个自定义主题:-
<style name="MyCustomToolBarTheme" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="android:textColorSecondary">@android:color/white</item>
</style>
<style name="CustomPopup" parent="ThemeOverlay.AppCompat.Light">
<item name="android:textColorSecondary">@android:color/white</item>
</style>
我也可以更改标题/菜单图标颜色。 但是溢出的图标颜色总是黑色。我什至尝试指定自定义图标也不起作用。
【问题讨论】:
-
图标颜色由
colorControlNormal定义,所以覆盖它。 (它在深色主题中指向android:textColorPrimary,在浅色主题中指向android:textColorSecondary。)
标签: android android-xml android-toolbar android-styles