2013-07-18 121 views
0

我喜欢holo light主题,但想要稍微改变颜色。所以,我想将操作栏上的背景从黑色更改为橙​​色。我会如何去做这件事?编辑Holo Light与黑色动作条

+1

可能重复[如何更改使用XML的ActionBarActivity的动作条的背景颜色?(http://stackoverflow.com/questions/8024706/how-do-i-变化的背景色的最-动作条-的-AN-actionbaractivity-US) – mmBs

回答

0

您可以创建可添加到主题的自定义样式。

<?xml version="1.0" encoding="utf-8"?> 
<resources> 
<!-- the theme applied to the application or activity --> 
<style name="MyActivityTheme" parent="@android:style/Theme.Holo.Light"> 
    <item name="android:actionBarStyle">@style/MyActionBar</item> 
    <!-- other activity and action bar styles here --> 
</style> 

<!-- style for the action bar backgrounds --> 
<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar"> 
    <!-- Use a color attribute defined in colors.xml --> 
    <item name="android:background">@color/orange</item> 
    <!-- Or use a regular color code (This is orange)--> 
    <item name="android:background">#F3D3D</item> 
</style>