同时采用ActionBarSherlock更改活动背景 [英] Change Activity Background while using ActionBarSherlock

查看:168
本文介绍了同时采用ActionBarSherlock更改活动背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经改变了我的ActionBar的背景颜色在我的应用程序,它工作得很好。但后来我想改变我的背景颜色在我的活动,现在它正在寻找相当糟糕。

I've changed the background color of my ActionBar in my App, and it worked fine. But then I wanted to change my background color in my activity and now it is looking quite bad.

下面是我的主题化的xml:
    

Here is my theming xml:

<style name="TucanActionBarStyle" parent="Widget.Sherlock.Light.ActionBar">
    <item name="android:background">@color/actionbar_green</item>
</style>


<style name="Theme.TucanActionBar" parent="@style/Theme.Sherlock.Light">
    <item name="android:actionBarStyle">@style/TucanActionBarStyle</item>   
    <item name="android:background">@android:color/white</item>
</style>

这就是它的外观:
http://dl.dropbox.com/u /2683101/Screenshot_2012-05-18-19-49-23.png

推荐答案

您应该使用的android:windowBackground 来更改活动的背景。更改的android:背景会影响到很多其他的事情,由于怎样的背景和 ContextThemeWrappers 用于

You should be using android:windowBackground to change the activity background. Changing android:background will affect many other things due to how the context and ContextThemeWrappers are used.

这篇关于同时采用ActionBarSherlock更改活动背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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