如何更改自定义创建的工具栏中菜单的颜色?

Arp*_*and 2 xml android android-layout android-menu android-studio

我有一个主页,我在其中创建了自定义工具栏,现在我需要向其中添加菜单项。到目前为止,我已经成功,我的search图标处于app:showAsAction="always"模式(白色),但是当我在app:showAsAction="never"模式中添加任何内容时,菜单指示器(三个点)显示为黑色,但我希望它们是白色的。

AndroidManifest.xml

<activity
        android:name=".HomePage"
        android:launchMode="singleTask" />
Run Code Online (Sandbox Code Playgroud)

actvity_homepage.xml

<com.google.android.material.appbar.AppBarLayout
    android:id="@+id/appBarLayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintVertical_bias="0"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent">

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?actionBarSize"
        app:titleTextColor="#ffffff"
        style="@style/ToolbarTheme"
        android:textAlignment="textStart"
        android:background="#2B772E"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
Run Code Online (Sandbox Code Playgroud)

homepage_menu.xml

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">

<item android:id="@+id/logoutmenu"
    android:title= "Log Out"
    android:icon="@drawable/logout"
    app:itemIconTint = "#ffffff"
    app:showAsAction="never"/>
<item
    android:id="@+id/search"
    android:icon="@drawable/search"
    app:showAsAction="always"
    android:title="Hello" />
</menu>
Run Code Online (Sandbox Code Playgroud)

这是结果

m.s*_*d.s 7

(first way) in your style :

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    ...
    <item name="actionOverflowButtonStyle">@style/MyOverflowButtonStyle</item>
</style>

<style name="MyOverflowButtonStyle" parent="Widget.AppCompat.ActionButton.Overflow">
    <item name="android:tint">#62ff00</item>
</style>
Run Code Online (Sandbox Code Playgroud)

Or you can change it with toolbar style like this:

<android.support.v7.widget.Toolbar
  ...
  theme="@style/MyToolbarStyle"
/>
Run Code Online (Sandbox Code Playgroud)

and in your style:

<style name="MyToolbarStyle" parent="ThemeOverlay.AppCompat.ActionBar">
  <item name="android:textColorSecondary">#333333</item>
</style>
Run Code Online (Sandbox Code Playgroud)