如何更改选项菜单点的颜色?

Sid*_*Sid 38 android menu colors options

我想将选项菜单的点颜色更改为白色.我试图为此添加图像但不起作用.这该怎么做?

在此输入图像描述

menu xml:

 <menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="com.example.siddhi.timetablelayout.Main2Activity">

    <item android:id="@+id/action_settings" android:title="@string/action_settings"
        android:orderInCategory="100" app:showAsAction="never"
        android:icon="@drawable/ic_more_vert_white_48dp"/>
</menu>
Run Code Online (Sandbox Code Playgroud)

谢谢.

ayz*_*sci 84

把它放进你style.xmlAppTheme:

<!-- android:textColorSecondary is the color of the menu overflow icon (three vertical dots) -->
<item name="android:textColorSecondary">@color/white</item>
Run Code Online (Sandbox Code Playgroud)

  • 根本不起作用 (14认同)
  • 我的主题是Theme.AppCompat.Light.NoActionBar.这对我不起作用.你能帮助我吗? (7认同)
  • 它还改变了Radio Buttons的颜色,这是大多数人不需要的.我猜. (3认同)
  • 把它放在你的style.xml中.AppTheme. (2认同)

And*_*eek 17

您可以使用以下样式声明更改用于它的图像.

<style name="MyCustomTheme" parent="style/Theme.Holo">
<item name="android:actionOverflowButtonStyle">@style/MyCustomTheme.OverFlow</item>

</style>

<style name="MyCustomTheme.OverFlow">
<item name="android:src">@drawable/my_overflow_image</item>

</style>
Run Code Online (Sandbox Code Playgroud)