自定義ActionBar樣式html
一、基於原有樣式進行相關屬性的修改,而後再AndroidManifest.xml對應android:theme中指定便可
android
<?xml version="1.0" encoding="utf-8"?>
app
<resources> ide
<!-- the theme applied to the application or activity --> 佈局
<style name="CustomActivityTheme" parent="@android :style/Theme.Holo"> spa
<item name="android:actionBarTabTextStyle">@style/CustomTabTextStyle</item> .net
<item name="android:actionBarDivider">@drawable/ab_divider</item> xml
<item name="android:actionBarItemBackground">@drawable/ab_item_background</item> htm
</style> blog
<!-- style for the action bar tab text -->
<style name="CustomTabTextStyle" parent="@android :style/TextAppearance.Holo">
<item name="android:textColor">#2456c2</item>
</style>
</resources>
二、自定義佈局文件,建立ActionBar,該方法相似於模擬佈局出一個ActionBar
①、定義actionbar樣式
②、AndroidManifest.xml指定對應主題
③、定義佈局樣式
④、在Activity的onCreate方法中調用ActionBar動態生成
方法一參考:
http://blog.csdn.net/gebitan505/article/details/12157027
http://hukai.me/android-training-course-in-chinese/basics/actionbar/styling.html
方法二參考:
http://jingyan.baidu.com/article/b87fe19eb399f052183568bf.html