gpt4 book ai didi

android - 使用 Material 设计更改工具栏的菜单背景

转载 作者:行者123 更新时间:2023-11-29 20:39:00 25 4
gpt4 key购买 nike

你好,我想改变我的菜单背景的风格,popupTheme 不会改变

我的工具栏代码

<android.support.v7.widget.Toolbar  xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/fondoNavigation"
android:theme="@style/CustomToolbar"
android:popupTheme="@style/ThemeOverlay.AppCompat.Dark">
</android.support.v7.widget.Toolbar>

我的风格

<style name="AppTheme" parent="AppTheme.Base">

</style>

<style name="AppTheme.Base" parent="Theme.AppCompat.NoActionBar">

<item name="colorPrimary">@color/fondoNavigation</item>
<item name="colorAccent">@color/letraNavigation</item>

</style>

<style name="CustomToolbar" parent="@style/ThemeOverlay.AppCompat.Light">
<item name="android:textColorPrimary">@color/letraNavigation</item>
<item name="android:textColorSecondary">@color/letraNavigation</item>
</style>

我的 v21 风格

<style name="AppTheme" parent="AppTheme.Base">
<item name="android:colorPrimary">@color/fondoNavigation</item>
<item name="android:colorAccent">@color/letraNavigation</item>
<item name="android:textColorPrimary">@color/fondoNavigation</item>
</style>

最佳答案

<style name="Theme.Dbtools_style" parent="@style/Theme.AppCompat.Light">

<!-- Title Text Color -->
<item name="actionMenuTextColor">@color/DimGray</item>
<item name="android:actionBarStyle">@style/MyActionBar</item>
<item name="android:dropDownListViewStyle">@style/PopupMenuListView</item>
</style>

<style name="PopupMenuListView" parent="@style/Widget.AppCompat.Light.ListView.DropDown">
<item name="android:divider">@color/DarkGray</item>
<item name="android:dividerHeight">0.5dp</item>
<item name="android:background">@color/White</item>
</style>
<style name="MyActionBar" parent="@style/Widget.AppCompat.Light.ActionBar">
<item name="android:background">@color/title_bar</item>
<item name="background">@color/title_bar</item>
<item name="android:titleTextStyle">@style/MyTheme.ActionBar.TitleTextStyle</item>
<item name="android:subtitleTextStyle">@style/MyTheme.ActionBar.TitleTextStyle</item>
<item name="titleTextStyle">@style/MyTheme.ActionBar.TitleTextStyle</item>
<item name="subtitleTextStyle">@style/MyTheme.ActionBar.TitleTextStyle</item>
</style>

关于android - 使用 Material 设计更改工具栏的菜单背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31155212/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com