Android的:如何改变操作栏的背景颜色? [英] Android: how to change action bar background color?

查看:135
本文介绍了Android的:如何改变操作栏的背景颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Andr​​oid应用程序的颜色为黑色。我想将其更改为其它颜色。什么是做到这一点的最简单的方法是什么?我努力使这一主题<一个href="http://jgilfelt.github.io/android-actionbarstylegenerator/#name=blue&compat=holo&theme=light&actionbarstyle=solid&texture=0&hairline=0&backColor=d0effa,100&secondaryColor=D6D6D6,100&tabColor=33B5E5,100&tertiaryColor=F2F2F2,100&accentColor=33B5E5,100&cabBackColor=FFFFFF,100&cabHighlightColor=33B5E5,100"相对=nofollow>链接

The color of my android application is black. I wish to change it to other color. What is the easiest way to do it? I have tried to make a theme from this link

在打开应用程序时,我能看到动作栏改变颜色从黑到其他颜色,但在3秒钟内,有一条消息:不幸的是,......已经停止。我希望用更简单的方法可能吧。任何帮助是极大的AP preciated。

When the application is opened, I could see that the action bar has changed the color from black to other color but in about 3 seconds, there is a message: Unfortunately, .... has stopped. I wish to use an easier way to may it. Any help is greatly appreciated.

推荐答案

要应用主题的所有活动,改变style.xml是这样的:

To apply the theme to all activities, change the style.xml like this:

<style name="AppTheme" parent="android:Theme.Holo.Light">
    <item name="android:actionBarStyle">@style/ActionBarTheme</item>
</style>

<style name="ActionBarTheme" parent="android:Widget.Holo.Light.ActionBar.Solid.Inverse">
    <item name="android:background">@color/action_bar</item>
</style>

而在colours.xml,使用:

And in colours.xml, use:

<color name="action_bar">#BA0000</color>

和在清单:

<application
    android:theme="@style/AppTheme" >

这篇关于Android的:如何改变操作栏的背景颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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