Android的:如何改变操作栏的背景颜色?

问题描述:

我的Andr​​oid应用程序的颜色为黑色。我想将其更改为其它颜色。什么是做到这一点的最简单的方法是什么?我努力使这一主题链接

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" >