我正在使用 xml 在我的工具栏上创建菜单和子菜单。
他们使用带有 alpha 波纹颜色的黑色。
与此同时,在其他菜单中,我正在使用弹出菜单,它正在使用 colorControlHighlight(我的样式中添加了金色)。
有没有办法将这种金色添加到通过 xml 创建的子菜单中生成的波纹中?
最佳答案
好吧,我直接在工具栏中使用 colorControlHighlight 解决了这个问题。
样式.xml
<style name="ToolbarStyle" parent="ThemeOverlay.AppCompat.Light">
<item name="android:colorBackground">@color/white</item>
<item name="android:textColor">@color/black</item>
<item name="colorControlHighlight">@color/color_accent</item>
</style>
layout_with_my_toolbar.xml
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:title="Toolbar Title"
app:popupTheme="@style/ToolbarStyle">
</android.support.v7.widget.Toolbar>
关于android - 工具栏中的波纹颜色子菜单项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45891209/