Android - SearchView и переполнение цветов значка MenuItem

Иконки на моей панели инструментов все черные, кроме SearchView и значок переполнения (три точки), который выглядит темно-серым цветом.

введите описание изображения здесь

Есть ли способ установить оттенок этих значков на черный, чтобы соответствовать другим значкам?

Вот тема, которую я использую, но, насколько я знаю, в этом нет ничего необычного.

<!-- Base application theme. -->
<style name="Theme.AnglersLog" parent="Base.Theme.AnglersLog">

</style>

<style name="Base.Theme.AnglersLog" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:logo">@android:color/transparent</item>

    <item name="colorPrimary">@color/anglers_log_light</item>
    <item name="colorPrimaryDark">@color/anglers_log_dark</item>
    <item name="colorAccent">@color/anglers_log_accent</item>

    <item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
</style>

И панель инструментов

<android.support.design.widget.AppBarLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?android:attr/actionBarSize"
        android:background="@color/anglers_log_light"/>

</android.support.design.widget.AppBarLayout>

Спасибо!

1 ответ

Решение

Вам нужно добавить тему в AppBarLayout и Toolbar как это:

<android.support.design.widget.AppBarLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" 
    android:theme="@style/ThemeOverlay.AppCompat.ActionBar" >

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?android:attr/actionBarSize"
        android:background="@color/colorAccent"
        android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

</android.support.design.widget.AppBarLayout>

Или если вы хотите темную тему:

<android.support.design.widget.AppBarLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" 
    android:theme="@style/@style/ThemeOverlay.AppCompat.Dark.ActionBar" >

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?android:attr/actionBarSize"
        android:background="@color/colorAccent"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        app:popupTheme="@style/ThemeOverlay.AppCompat" />

</android.support.design.widget.AppBarLayout>
Другие вопросы по тегам