更改背景单独ActionBarSherlock的。没有标签 [英] Change background of the ActionBarSherlock alone. Not the Tabs

查看:119
本文介绍了更改背景单独ActionBarSherlock的。没有标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用这个code改变ActionBarSherlock的颜色:

I used this code to change the Color of ActionBarSherlock:

    <style name="Theme.MyTheme" parent="Theme.Sherlock.Light.DarkActionBar">

    <!-- set style for action bar (affects tab bar too) -->
    <item name="actionBarStyle">@style/Widget.MyTheme.ActionBar</item>
    <item name="android:actionBarStyle">@style/Widget.MyTheme.ActionBar</item>
    <!-- define text style for tabs -->
    <item name="actionBarTabTextStyle">@style/MyTheme.ActionBar.TabText</item>
    <item name="android:actionBarTabTextStyle">@style/MyTheme.ActionBar.TabText</item>
</style>

<style name="Widget.MyTheme.ActionBar" parent="Widget.Sherlock.ActionBar">

    <!-- define background for action bar (sets default for all parts of action bar - main, stacked, split) -->
    <item name="android:background">#blue</item>
    <item name="background">#blue</item>
    <item name="android:titleTextStyle">@style/MyTheme.ActionBar.TitleTextStyleWhite</item>
    <item name="titleTextStyle">@style/MyTheme.ActionBar.TitleTextStyleWhite</item>

    <!-- set background for the tab bar (stacked action bar) - it overrides the background property -->
    <item name="android:backgroundStacked">#grey</item>
    <item name="backgroundStacked">#grey</item>
</style>

<style name="MyTheme.ActionBar.TabText" parent="Widget.Sherlock.ActionBar.TabText">
    <item name="android:textColor">#black</item>
</style>

<style name="MyTheme.ActionBar.TitleTextStyleWhite" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
    <item name="android:textColor">#white</item>
</style>

所建议的杰克沃顿在这里:

as suggested by Jake Warton here:

<一个href="http://stackoverflow.com/questions/10064411/change-actionbarsherlock-background-color/10065819#10065819#answers-header">Change ActionBarSherlock背景颜色

但事实是在动作条和标签两个变化为颜色。其实我是想修改热门动作条的背景蓝色标签背景,以白色

But the thing is the ActionBar and Tabs both change to Blue color. I actually want to change The top actionBar background to Blue and Tabs background to White

如何做到这一点?

感谢您

推荐答案

使用 ActionbarStyleGenerator 改变的颜色是什么一切你需要的。这是目前为止最简单和最直观的方式。

Use ActionbarStyleGenerator to change the color of what all you need. This is by far the simplest and most intuitive way.

如何:

  1. 使用的用户界面来选择颜色为不同的项目。
  2. 在下载完成后点击.ZIP
  3. 在ZIP将包含在您需要在您的项目复制RES /布局和RES / drawableXXXX文件夹所需的文件夹中的资源文件

这篇关于更改背景单独ActionBarSherlock的。没有标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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