您可以在<application>
标记中使用android:theme=theme_style
。现在,如果您希望动作栏与主题给出的动作栏不同,则可以通过专门为您的动作栏定义<style></style
之间的样式来覆盖它。
这是概念。去res > values > styles.xml
。您可以如下扩展或自定义主题:
<style name="AppBaseTheme" parent="android:Theme.Light">
<item name="android:background">@color/background_dark</item>
</style>
更新: 或者如果你想为所有应用程序的通用(不是主题特定)的变化,那么你可以编辑sdk/platforms/android-target/data/res/values/styles.xml
或者如果你要覆盖所有应用程序的默认主题,那么您可以编辑sdk/platforms/android-target/data/res/values/themes.xml
更新 - 发现这个:
ActionBar developer docs。该链接指出:“您可以使用在Android 3.0(API级别11)中添加的ActionBar API来控制操作栏的行为和可见性。”所以我认为你的目标至少是API 11。
如果你的目标API 11以上,你可以做高级定制样式如下:
<resources>
<style name="CustomActivityTheme" parent="@android:style/Theme.Holo">
<item name="android:actionBarStyle">@style/MyActionBar</item>
</style>
<style name="MyActionBar" parent="@android:style/Widget.Holo.ActionBar">
<item name="android:background">@drawable/ab_background</item>
<item name="android:backgroundStacked">@drawable/ab_background</item>
<item name="android:backgroundSplit">@drawable/ab_split_background</item>
</style>
</resources>
在这里你去,Styling Action Bar background
http://whathaveyoutried.com? – njzk2