如何保持动作条项目“的背景不变,而改变了应用程序的主要背景是什么?背景、应用程序、动作、改变了

2023-09-12 03:22:54 作者:浅若清风

我试图改变应用程序的背景,但是当我做了以下(SDK 14)在动作条中的项目也改变以匹配新的背景颜色。在动作条的自身的具有正确的背景,但在动作条中的项目没有。我能得到的actionbarmenuitems是正确的,但标题和搜索视图和家庭图标和后退按钮都有背景上的自定义主题设置。我究竟做错了什么?

I am trying to change the background of the app, but when I do the below (sdk 14) the items in the actionbar also change to match the new background color. The actionbar itself has the correct background, but the items in the actionbar do not. I was able to get the actionbarmenuitems to be correct, but the title and search view and home icon and back button all have the background set on the custom theme. What am I doing wrong?

<?xml version="1.0" encoding="utf-8"?>
<resources>
   <style name="Theme.Holo.DarkerBack" parent="@android:style/Theme.Holo.Light.DarkActionBar">
      <item name="android:background">@color/background</item>
      <item name="android:actionBarStyle">@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse</item>
   </style>
</resources>

推荐答案

尝试更换

<item name="android:background">@color/background</item>

 <item name="android:windowBackground">@color/background</item>