如何保持动作条项目“的背景不变,而改变了应用程序的主要背景是什么? [英] How do I keep ActionBar items' background the same while changing the app's main background?

查看:158
本文介绍了如何保持动作条项目“的背景不变,而改变了应用程序的主要背景是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图改变应用程序的背景,但是当我做了以下(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>

这篇关于如何保持动作条项目“的背景不变,而改变了应用程序的主要背景是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆