2017-08-26 61 views
1

我正在使用xml在我的工具欄上創建菜單和子菜單。工具欄中的波紋顏色子菜單項

他們使用黑色alpha波紋顏色。

同時在其他菜單中,我使用彈出菜單,它使用colorControlHighlight(在我的樣式中添加了金色)。

有沒有辦法將這種金色添加到通過xml創建的子菜單中生成的漣漪?

回答

0

那麼我直接在我的工具欄中使用colorControlHighlight解決它。

Styles.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>