您可以在<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